|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
) i* W; Q9 u" \4 G( H9 h( t/ R. ]1 o// Theme Option |* B' N7 q" G- R/ M
////////////////////////////////////////////////////////////////////////////////( Q! Z$ m4 i( K9 Q- q3 J
+ w' x7 D. N8 r y0 I/ } n$themename = "Zenx";* n0 k1 P( i+ H+ |) I
$shortname = str_replace(' ', '_', strtolower($themename));
" ^( i" `9 M- a2 Z0 r; C) o. Z5 W" f& d
) G5 [' Q9 r% i- i; W# S8 D4 Tfunction get_theme_option($option)( ]! I* v# K. P2 i9 b2 r
{
1 Y ^; L5 k; D global $shortname;7 g4 c" X7 z2 @8 T4 B2 T
return stripslashes(get_option($shortname . '_' . $option));
* }% h+ s: Q# h}
' _) R6 }/ Z/ R
' w3 A+ p" _8 p+ d! H1 pfunction get_theme_settings($option)- `% T( D& Z l4 t3 T `+ O
{
" h% ^: n* }- T" M8 V return stripslashes(get_option($option));
u& O& I, X8 @}
. j+ M" J6 u% e* ^- i* j$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");; H# {% U7 {5 b6 L) {7 n+ Y9 w6 i
$wp_getcat = array();5 {8 B9 T x. r- v/ x
foreach ($wp_dropdown_rd_admin as $category_list) {
) e3 }3 D4 r5 V. [! J. ]9 \# I! l& x% L$wp_getcat[$category_list->term_id] = $category_list->name;
9 K: T7 I. k5 g: q Q0 L}
* u4 A# U! c& D) M. n; d$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");/ }+ q) \/ F7 J! r
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
6 G$ I/ a! E' |& t, J; T$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");* V3 l, ~: R) ~& ?% L# [+ ~3 S/ n
" Q# N7 ~2 ?( a. B8 P
$options = array (
5 V- s5 k9 e$ e( o' O( i0 L4 y% o; q6 z
4 G; k5 K4 f: t. o' b/ N. F
array( "name" => "Blog Header Settings",$ z4 H; \0 f4 F2 N. q0 k9 \" h4 k
"type" => "heading",7 h. o/ @0 J/ e. b0 T
),
4 ]3 K, L- t3 H- v9 E3 Y8 k* `/ u D
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 L7 N2 {5 E+ i
"id" => $shortname."_header_logo_activate",
/ {% H* T' d% X U! s, a7 y "type" => "select",9 a6 g" o9 [3 e* _6 u- t8 y
"std" => "No",
; M" d$ z. Y; i5 i" p8 b "options" => array("No", "Yes")),/ i. ~' S" p I9 N
0 ]9 w% a, j; V! t3 a9 ] array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",* |, S( h+ h- S1 l6 H# W) _7 x
"id" => $shortname."_logo_url",9 D: r& t6 y/ K" R7 F/ z
"type" => "text",
1 s% \6 R" r% d& m$ b( R( B "box" => "social",
5 g6 c2 ^/ V3 q/ m "std" => "",; {! K' Y$ }6 B& e# Z' y5 q. k
),1 d$ ?9 G0 |" W, G% x7 H5 t9 Z3 S
/ _5 B) v! N3 l8 \) I array( "name" => "Insert Header Banner HTML Code (Header)
" K* I5 z6 _0 t$ i <br /><em>*Recommended Size 468 x 60</em>
$ k' n: j) W' Q0 _2 M; m# U <br /><em>*leave blank if not use</em>",
. N; f2 Z8 R; F% b6 J# b "id" => $shortname."_header_banner",
$ t. |5 a6 }3 }2 e6 U, D' ]4 l "type" => "textarea",
7 d8 \' [% N u& h "std" => "",
) v Z" t% ]8 W/ z! ~3 D) Y# O ^ ),
' ^5 r1 K& A) b+ G
' ?" t/ `& ^- p/ q0 l array( "name" => "</div></div>",/ {7 U& H' _# K) k4 ^8 j
"type" => "close",# `( g. x# H) `3 [1 G
),
8 \, L: T' V( B. M- G3 z) K# D1 M, j* \2 F5 `- ]5 Y
h& w* z" {0 _5 c! g- [, T' F
array( "name" => "Header Navigation Settings",* D2 y; U" P2 c, e" W; v
"type" => "heading",/ E" U% X; _$ z; n/ V
),2 O G" K2 Z8 j" I
; f5 p2 z1 N+ O' h7 o! D2 h( M/ F
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />4 v* N c- i- a0 _$ L
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
; }1 y' u8 v( v4 Z, N! J <em>*Enter the page post ID number only</em><br />9 Q U3 e& n% B* B
<em>*separate by comma</em><br />
0 W" T- k( D1 C$ z2 o; F+ U2 p0 j- j! M <em>*Exclude pages which you don't want to show on the header navigation</em>",4 C7 R7 B4 B0 k2 T
"id" => $shortname."_header_page_navigation",! w6 n% n6 G! S
"type" => "text",
9 F G' J/ S; J) L "std" => "",
9 o1 R, { V; G* w4 j ),
8 a! q' d& @! n0 G/ P
& w: @- d. B4 i array( "name" => "</div></div>",- s7 ~9 Y8 u% e) R
"type" => "close",
# S. r' z& \2 d ),
9 X7 v; @2 O- N
+ q% l5 g7 G3 R9 {0 M# A5 u$ ~. ]6 Q/ @0 u B7 D4 t6 U
array( "name" => "Post Auto Thumbnails Settings",5 O8 \( n$ n/ x2 z4 F# X
"type" => "heading",
0 M' g+ c! I' D ), G; e1 \ v8 i% _3 G
7 V7 m; c: }* H- n/ u7 G% l: [' r
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
* K( p( w- U8 \7 @8 e "id" => $shortname."_timthumb_activate",, }4 {% d" v4 r7 P3 t/ ~3 \$ L6 x
"type" => "select",
1 _/ t$ m5 [! V- p, T "std" => "No",
$ Q3 X' ?5 M6 N, e, f3 M "options" => array("No", "Yes")),
- |" ~4 b3 G3 W- I6 W; a: P7 R - m% v( _7 L: q. E# X
array( "name" => "If Timthumb is enabled, Please choose its cropping method",# @7 U+ P4 u) A1 `
"id" => $shortname."_timthumb_cropping",
8 ^; z$ J" U, O' O9 G/ Q0 m: |* Q$ n "type" => "select",
- G* Y* `" K! {+ p& R "std" => "",, S6 p0 ~* }( e3 F
"options" => $crop_position), G2 S7 s; x* i& b
3 h5 l! a" j( J ?
array( "name" => "Insert Width Of Thumbnail Image<br />
3 j0 K6 C: d- t$ b <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
. `2 D x9 |4 P1 C# q% N( q <em>*Leave Blank To Use Default: 250</em><br />",2 A) v5 D5 }& L9 g% D4 D4 `
"id" => $shortname."_thumb_width",
0 G) |7 ^( t1 |7 s$ G0 D$ K# x7 w "type" => "text",
0 E9 w- W' K) [% r "std" => "",7 }3 C! `" `! d
),$ P3 V6 S; e9 ~: c% d* F. `; T
8 F3 J% L, n: [* p. I array( "name" => "Insert Height Of Thumbnail Image<br />+ ~% [. P( q/ h( g3 F- |
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
/ X D- _! G. B2 O) @0 a/ y <em>*Leave Blank To Use Default: 200</em><br />",
+ Y) S0 h [' B" J1 R7 ] "id" => $shortname."_thumb_height",0 f0 P! |% S- P/ z1 D0 Y# K
"type" => "text",
* v( L: \+ K( R "std" => "",0 k- I3 Y. b+ ?/ r
),/ r* |) A% g/ z2 H
2 Y) |" F6 f2 e* V( X1 R) U array( "name" => "</div></div>",* u0 \2 k, V% l4 {
"type" => "close",
: i" J' c: e& b; z* D ),
1 O) D# r* y" Q! s# f- z( v# Q7 @! w
array( "name" => "Featured Content Slider Settings",+ _' b! ? |$ x- q
"type" => "heading",
8 p) y" a) W6 e9 O' p. K ),
$ h: ^: T, [- j j3 X: N7 b! i4 q- h/ z0 _( j3 L) y1 l; g
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 e. ` k1 F2 h' `* v9 W
"id" => $shortname."_featured_activate",
|/ P3 P2 D8 h6 S3 q3 K, g h "type" => "select",( r6 X5 E; o0 Y( E7 G e
"std" => "No",
4 {. x, w8 l% m "options" => array("No", "Yes")),
% w! i# o$ p2 d% j: k, R- p# u$ g; h' t8 w' [+ {
" n4 I+ N( X8 c$ x2 D' b/ ~" e
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",2 V0 d4 P* A1 b
"id" => $shortname."_featured_category",; d) o/ T0 x/ W
"type" => "select",+ V) K+ H) M. A
"std" => "Choose a category:",
7 V. N: A+ _: E# B* \ "options" => $wp_getcat),
+ e& Z! k/ _. }$ h
2 a+ w4 V; u* d/ U array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
; F! z+ c7 G5 C9 `3 {+ x "id" => $shortname."_featured_number",
& H9 T n6 H! `1 K, S "type" => "select",: N/ [/ ]7 ~7 l
"std" => "Number of post:",
9 g q, S& E8 m! I! _5 y "options" => $number_entries),
. M. K7 M8 r, X! |# \2 S5 w: s# L/ q1 n7 u3 y( k* r
array( "name" => "</div></div>",
: [+ v8 o$ C& ?( p, s* s) u' v "type" => "close",( t( ~, d) P" v. N( I& s# u2 A
),
( a3 {- C7 I5 S1 f
4 P1 M: `! K* k4 [ array( "name" => "Featured Category Settings"," ?/ r5 ]+ S! Q" D
"type" => "heading",
% a# }0 C7 L0 n4 a" I+ C ),
* h3 l7 a. \( h0 m6 B/ i8 @9 h( D7 w/ R: O) W$ [
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! r" I: S( d9 o: V1 J( l) G
"id" => $shortname."_featured_category_activate",5 S& i; l6 t0 ?$ D/ M( }
"type" => "select",4 I/ I/ k/ ^# O A* }& t: E5 d# W6 y
"std" => "No",
; b, @: B u' G r7 c: s "options" => array("No", "Yes")),3 p6 f8 V0 k) D/ b) ~# O
1 e0 @/ L8 y/ ~ V3 u; ~1 y7 ~
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
2 t. w# ~* }5 G "id" => $shortname."_featured_category_id1",
b8 A3 X: W* y2 V* ^) s "type" => "select",
* R3 @0 Q7 [6 d. p# r "std" => "Choose a category:",4 s4 e9 |$ F) A. L; d6 _8 I
"options" => $wp_getcat),4 N# B8 W5 b- ~5 ?8 h" _- f
9 Q0 F/ `+ U5 z a3 g- G. K; C' x( G array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",7 ?3 _! S: A& @( o: R8 I
"id" => $shortname."_featured_number1",
, F+ G+ d2 |$ m0 ~( u/ j "type" => "select",
, s+ u9 L8 T( G4 ? "std" => "Number of post:",
; V1 ]& t0 t4 J6 O* t- M "options" => $number_entries),: t% ^: G; t2 {0 E; u
4 _- P# A, Q/ r
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
( d9 B9 S5 t6 x4 O9 j) `# E$ ]6 N "id" => $shortname."_featured_category_id2",# t% Q- D* r' |- B
"type" => "select",. x" |' ]( I0 x6 u
"std" => "Choose a category:",
$ S. ~# Z7 `! h g9 F; T; n "options" => $wp_getcat),+ X; i! T, B9 H6 O
! M* w4 o- J, C" r7 I# S array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",) g, {! ]2 w2 K ?
"id" => $shortname."_featured_number2",
- d2 A3 G# D9 o& ?+ \ "type" => "select",
* j/ s) J: w- D. c, p9 w t D2 w) i2 R "std" => "Number of post:",1 h1 |' v: ]3 u+ ?/ Q; u9 W
"options" => $number_entries),
: R, F+ U& o! U9 R, l * U" m% S1 a" j2 G* d
8 Z( g% _! R1 W7 e& C6 M( j array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
2 o D/ h% h0 t. y/ Y0 K. Y "id" => $shortname."_featured_category_id3",* a) j0 P" T5 o7 A: j
"type" => "select",0 M C8 c( _' R# G
"std" => "Choose a category:",! s( i- E( U, n. h* t
"options" => $wp_getcat),
+ m, g+ y7 c& W
$ A! ~4 C, p8 @) q array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",3 R: U T6 L0 X" y
"id" => $shortname."_featured_number3",
) r7 I- d3 }; h+ \3 k "type" => "select",) `) x6 H3 S% }
"std" => "Number of post:",
( f2 W* q1 k3 \8 N5 V, r: Y "options" => $number_entries),- z5 D7 |3 p1 V( P
& p7 B. D. H' |6 |6 T ~6 u( `1 Q
* R2 M0 N0 ^& c/ D% L
array( "name" => "</div></div>",
2 I/ v, e! Y0 i5 i5 p$ D+ B "type" => "close",
. [: D5 R( r3 ]: t. Y5 I; Z ),
. H1 |' S! K* X" \6 [
: k( ^$ f9 {. q. f' D3 ? h {5 Z2 e: E$ s7 C9 O, T2 L
array( "name" => "Google Adsense & Analytics Settings",3 ~4 I3 g( f! h( H
"type" => "heading",, [% X1 B% ^' \. ]" r
),8 @& [' E' Y) x. x3 i
. V- o( l; z8 [* h2 B$ e i
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
; ?" n+ w: L! l7 U1 x0 A "id" => $shortname."_adsense_loop_activate",
# Y4 U& P7 F# q+ h8 a. s/ S "type" => "select",
* F( Z' P9 A, [0 k9 c "std" => "Disable",7 Z( B0 w* p# }# P& z4 P
"options" => array("Disable", "Enable")),. m A- r( s! L# v+ n S" C
6 @$ w7 K( r( h1 D& e array( "name" => "Insert Google Adsense Code For Loops Here<br />
* f! m+ j, l5 b <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",7 F R; U9 l5 D! I8 O( c4 t0 U
"id" => $shortname."_adsense_loop", ^+ a/ @' t) ]" l \# B
"type" => "textarea",$ r' [- A' `5 C+ u
"std" => "",
& ]; T0 u2 g/ U) A0 o ),8 a d: H- a D8 Z: |! f' m
& Z% }5 f9 a, f5 F* _ array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
% G( H5 a: n; I; a w* } "id" => $shortname."_adsense_single_activate",
X! Y) s) M" F; d/ U "type" => "select",
/ |2 f1 B$ T9 Z2 I& D "std" => "Disable",( m, C/ t& y/ `& Q" ~: ~ I2 K
"options" => array("Disable", "Enable")),# \& W. x8 F. J" ~/ D
6 n9 M# g2 M& D: T! `1 X$ A( p
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
4 F- H7 q, \+ P- f( N3 C' x8 z" ] <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
5 z9 r9 B: |. P/ t, R "id" => $shortname."_adsense_single",
) G \4 _; h, p5 v# S \- B/ E "type" => "textarea",3 G8 y/ z! v' [# G8 V
"std" => "",7 q; |; H8 \ I) O6 c9 m3 H
),
8 P3 V& r+ S9 {; M" \$ }/ J4 O& m! X5 y3 U! x3 y& Y6 x
8 I; {9 \" {% |, P/ y9 h' q
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",' r6 W$ T- w! w3 W5 [$ l5 s1 W
"id" => $shortname."_google_analytics",
, K; r* [- t2 K' t" \+ u% r7 ? "type" => "textarea",0 _. R* H0 i+ k f8 t
"std" => "",9 C: C% a" T# T7 G9 n9 B
),# D; E+ |) r; E1 I
0 D2 C' u% Z% H. w8 w# B- F/ h array( "name" => "</div></div>",
7 I; o5 Q9 T( O7 u$ E "type" => "close",8 R" N$ V2 z0 }
),
* l, o+ a V5 _
$ ]& y5 U* o3 m
, A) j4 r: b! G0 ]: d array( "name" => "AddThis Social Bookmarking Settings",2 E+ y2 Q% P7 |" _" O) I5 J+ e
"type" => "heading",
6 E6 h+ [; j, I; g) D ),5 ?3 W7 g& R( o
5 r; a9 V5 K0 A! s& W8 l
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
) ]+ e6 p. a5 q5 I( q/ j( Z <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",' V/ c& O( i) G* r! E U: V
"id" => $shortname."_addthis",
0 J- Y$ ~+ S3 c. d$ l "type" => "text",
( F8 R: O1 u. w6 l5 n ]0 M1 P "box" => "social",
# D+ Y( Y. T% _8 }9 u$ L1 b: N "std" => "",
9 {4 _ i0 g" x ),, H+ o) m8 S. @5 t9 Z
+ D" ^) ]) W+ J# D: E! P: m1 g1 Q array( "name" => "</div></div>",+ a1 M, T7 J' F: |
"type" => "close",) c$ }$ q0 K. {: i m
),, V7 p& B9 H" v4 A* |5 Q# z
$ W! y# `4 W$ \, v f& s0 x
" J4 f. C' c7 m( z 5 ], O8 P1 w: F2 I, Q6 V+ }
array( "name" => "YouTube Video Settings",. @+ t3 Z$ ]1 g6 F: M
"type" => "heading",
$ B, T. _) B4 m7 l ),2 i% A* O. O, F5 m) i& B5 M( O6 S# \
# K8 i+ U& i/ n7 n array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",, g$ Q3 j3 @4 g' ]( ?' F
"id" => $shortname."_emvideo_activate",0 \0 e S" p/ p3 `6 N* @
"type" => "select",% G% F0 }# v9 a$ T# I- }- O
"std" => "No",
' t9 B5 @/ f. z2 \3 _ "options" => array("No", "Yes")),
* G3 ~% Y$ _; {
1 @# w; r; t. ]/ t/ d& } array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
" Y* x& v4 ]+ w) \8 D "id" => $shortname."_emvideo",
% j( P) r T5 H' C "std" => "",% `- H8 a: i7 ?9 Y: L9 o5 Z3 z
"type" => "text"),+ r% ]7 D1 {9 k9 ]6 {0 b/ K c
' x; w- F1 L& O1 L8 ~ array( "name" => "</div></div>",
& Y. ^. N5 {# r- U: i; F8 ] "type" => "close",1 ]# Z# j2 L0 G$ p7 s, {/ |
),, {: V/ V7 J+ n4 o
r6 A, I! F1 N6 x( g @8 A. Q/ A array( "name" => "Twitter Settings",
( U# K0 f l' G% T, X( V "type" => "heading",) s% o2 z9 j' Y9 _. M- ~3 F6 x
),
- }, o) \* S, G; g- U$ b2 W. `8 J, O8 @8 @8 G7 ?/ J1 S, h
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
~, q$ E2 i( n) q$ R "id" => $shortname."_twitter_activate",: v, u3 ~2 }, P& ^0 b3 v! ~
"type" => "select",* j5 i, M3 I. K# q
"std" => "No",3 }9 w0 Z& r" h
"options" => array("No", "Yes")),
; D( \4 v* i1 B
% k' X' [% t' m, e% S0 M* J# q array( "name" => "Insert Your Twitter ID here
; H& ]# `8 a6 Y) j I( H <br /><em>*leave blank if not necessary</em>
) ?7 H" Q0 | h( n: ~* l <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",, C5 |; Y8 Q) `
"id" => $shortname."_twitter",+ a: W) h% r( J$ T+ W1 Q- M3 N/ C
"type" => "text",
# @: U1 a; I" N4 w5 i9 A y "box" => "social",
' H9 d# Q3 ^" V6 `, i* I8 b "std" => "",; M+ b X" j/ U( w. E# F! z* X8 G& E ?
),
% m- d5 a1 f$ D4 Y% { m8 W1 n) C# b7 x3 q
array( "name" => "Enter Twitter Feed Count here
/ B! ^ l, h* d; R1 j# i <br /><em>*leave blank if not necessary</em>- Q2 p, W3 E) l- c# b* Z y5 j
<br /><em>*Enter How Many Twitter Feed To Display</em>",+ ?9 O4 c% e, O1 z" p2 @0 [
"id" => $shortname."_twitter_count",* q/ p4 `7 h& L- a: ? C
"type" => "text",
) U+ |& _' M* b5 U. N! B1 } "box" => "social",
( f2 _* s& e: ]$ B "std" => "",
@( f7 B' x# r+ _+ y( h" B ),
: K H* L! ^+ n/ j; n% c# \& X: n! I" K
array( "name" => "</div></div>",6 N' o0 \( E5 U# N% k4 \2 k
"type" => "close",
. h2 X4 q8 _9 H9 z ),
) G" E# M1 d$ }" T $ n/ K# v8 I# ~1 r/ ~' d
/ k$ h# l% R- Q
array( "name" => "125 x 125 Banners Advertisement Settings",
/ o6 [0 ]; k+ T L. v "type" => "heading",4 i7 ]# W4 G3 v' K) v
),; R1 n: J1 i4 k2 }3 K& q |
7 y; x+ Y8 }5 {' W' f1 H
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 ~3 z( |5 i6 Z' n0 E
"id" => $shortname."_sponsor_activate",8 ]1 N7 b3 K) F1 J5 f V3 m
"type" => "select",
$ b" E5 V- \; ^) C" q "std" => "No",$ m5 | R1 l1 G5 A+ V* O
"options" => array("No", "Yes")),
5 A$ C& L3 h, Z) I 2 a: S, t' P( g7 v
( |5 _& r: d1 J) H9 n array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",6 y: [/ Z0 @9 S9 @+ H/ y% W
"id" => $shortname."_sponsor_banner_one",# h0 `8 v+ M" g# \' j: }
"type" => "textarea",
& w g" a- }+ A7 J6 Q' Y0 g "std" => "",0 E6 w( N1 ^; Z& Z( R
), ) Q% G& ?; x, f; `7 j, o4 Q
# q1 M" T; P9 ?/ w* H5 y: z" S4 C; w
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
) {1 w1 O! n% |& v* i" m& W "id" => $shortname."_sponsor_banner_two",
& D: ?7 O; m* W D3 V8 u- J( P "type" => "textarea",
) L. N* F" X% z/ ] "std" => "",- V$ o/ N3 c# e) w* T! V
),, ~% I/ \- F9 R8 t
/ K& s3 D, X; G1 [+ q& [
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",: j0 m" A9 a, {+ d8 w
"id" => $shortname."_sponsor_banner_three",
) e W3 ^4 m' y "type" => "textarea",
9 |$ g/ t* p; ?3 f$ V "std" => "",, a: s* O. c+ Z9 R$ z, U. _
),
0 b* n" `3 i2 t# q7 m, A
- G" I/ V* d1 E( O array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
1 R* z4 r9 P" E, j- }" G, c+ x "id" => $shortname."_sponsor_banner_four",
! |; {, ^, |8 D7 _$ E( m% ?& t: ` "type" => "textarea",
( R# [: d; f2 B% O- C "std" => "",
% \1 j- b- i+ I' ?7 C+ \6 C: ~ ),# [+ @1 i3 z! V) w1 h' `+ i
8 u$ B' K- z. }) J) o9 x# G8 a array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",8 ?* r( M! p; Z5 N$ N/ v7 l1 b$ d
"id" => $shortname."_sponsor_banner_five",
% l. C% K# U2 u' U/ J "type" => "textarea",
0 _8 R% N$ m0 ?0 f "std" => "",: g {: d4 Y% v
),: o N" M( B# p, w& h
1 t- b/ l6 I( }" i3 F0 ]5 l. h
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",- u5 L! e& N& @& N. R, R
"id" => $shortname."_sponsor_banner_six",7 n8 z. n6 h- b, T
"type" => "textarea",7 D2 V8 G X; Q$ O2 o" v6 v
"std" => "",
" H* _7 X3 [) T7 I; l ),' h+ `5 ~5 d6 p2 B. E8 A+ X
- ~# a, O4 E( |3 v- v( z array( "name" => "</div></div>",
+ ^9 F" Z- h2 p- m "type" => "close",
% d8 ?4 q+ @7 I" P0 J8 Y- m2 g5 j ),
& y- M8 x2 J- r& G' m+ S' S- r# X( R2 }) I3 S T. }. x1 V
! S) Z9 u g5 B' q
# W, N# @4 ?! A \- k5 y4 J7 ?); s' l7 y9 Q$ S% o( r% v* C
4 G& e2 o0 Q. u) D! ufunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
' {* m; u2 @3 Z! z4 d7 o' X& Q$ f% S; n- T" W3 L- X9 W% {+ p
echo "<div id=\"admin-options\"> ";
6 G) _4 H' t9 p6 p \$ O( u. I2 A/ m0 G9 V U4 G
global $themename, $shortname, $options; N8 {, [% F+ G* X- ^. _
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
& r( h) x4 l8 _6 R) Q, E) Zif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';- v& W. N% i2 c6 q
?>4 Y9 q! c5 N" }- Q$ u
, g2 n, k! ~# y: I- C& l
<h4><?php echo "$themename"; ?> Theme Options</h4>
8 ^& X3 `! m, p5 q2 M
+ p7 a8 ]8 e* [, s<div class="annouce">
7 G' E! m$ i/ U& d$ N/ W9 S<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>/ J3 L0 E/ b$ {# x& ^. K; W
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>' M2 v" i8 s0 A) m f' t8 ` G
</div>. z9 a" H% t0 P0 `
7 S( I% f) c' b
<form action="" method="post"># r+ `1 l% x# u4 r! w, S
! Y$ ^1 D! z' ?: P3 o' D<?php foreach ($options as $value) { ?>
, h& }5 a- I1 j. p9 B0 d8 Z8 i4 E8 N6 x0 o
<?php switch ( $value['type'] ) { case 'heading': ?>
! B0 e5 M/ G0 m% P! o
2 q0 l. [) g3 p p& ?8 q3 J<div class="get-option">6 Q- D$ B# a3 M8 k
7 P$ ]) ^0 g$ M2 g
<h2><?php echo $value['name']; ?></h2>, ?; M2 M4 C; A' q
* h% A/ d s* P<div class="option-save">
. T5 G+ H2 d% T" [" |% ? C
6 Z( n# R% e6 o4 E) [$ H<?php
& }1 Z8 [0 D6 I1 cbreak;4 Q0 i% E# o' x8 Z- i C) J
case 'text':
' P- K S/ ^2 @( y' E$ U5 b?>
' K9 E6 w. o; {2 E. C. t" {; z" Z4 e$ d) C2 B7 p
<div class="description"><?php echo $value['name']; ?></div>! l5 A6 h* o& P# `' X0 @1 s1 r
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (5 d; X: {+ @: Z% V6 D
, V6 h* j/ g9 l& ?+ l
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>) T d5 j' \) P- B1 [+ }5 Y
5 i( S: Z! |9 g- [7 K4 a4 \, D<?php" ?. ?* d% S" S# {, A
break;5 I' c, q' ^) T* P! [' l3 y
case 'select':
8 c2 \* j3 x& Z# G* y?> n4 j% x! D" J2 T/ b0 x0 K
/ E3 F1 _% l. n# B) U<div class="description"><?php echo $value['name']; ?></div>, u. c' k( e. p. n
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">; f2 U1 g* N6 C+ n7 b) t! @5 l
<?php foreach ($value['options'] as $option) { ?>3 r3 _9 q* E f6 `" I& g, K
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>3 \! Y& g# ` D- W j D
<?php } ?>
& P. ^( h# i6 M! }. w- P) K</select>( _" b* G5 S& F6 y [0 b% e
</p>' v; _, F5 n. l& R& e3 P& t
. K- J0 c! P* V5 Y<?php
" V2 [8 r$ w. q4 S% L8 Wbreak;
/ s+ V. `' P6 o |% V! D/ g1 Icase 'textarea':
2 \, O! N$ p# Z5 d2 {( L% w$valuex = $value['id'];9 j% j/ j6 _1 ^" D3 s0 G
$valuey = stripslashes($valuex);
: f) b7 g+ ^: o5 Y" b; o) w- j$video_code = get_settings($valuey);
7 U$ l% j; H- x- Z& u?>
3 Y y0 Z9 t& S2 w* }" s0 }
" X- k5 s( l6 s. i% I1 ^/ n. Y<div class="description"><?php echo $value['name']; ?></div>/ }+ m0 E+ @7 w7 B% }1 {! T
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }, k$ Y; ]% D1 }% `: t
9 o( j5 m/ U q6 zelse { echo $value['std']; } ?></textarea></p>8 a/ z# z0 z. T7 H$ `* {& }
5 h$ \" o3 o8 e7 I6 e
<?php' @6 p1 g, A$ s3 a1 q4 D% w7 v
break;
' ^8 F' x4 K9 d& _6 wcase 'close':
" T* n* x2 m. e?>9 `) `$ D0 B" B- c
+ X$ F7 f6 U& h( R2 }1 O
<div class="clearfix"></div>
& P" U- f- U% F7 w2 _( j, ^, s+ {, L2 f</div><!-- OPTION SAVE END -->
( z5 x$ e( D2 i1 g
/ K ~% ?1 r+ y$ E( h' o, r<div class="clearfix"></div>- W% u$ _9 S+ C+ N5 v
</div><!-- GET OPTION END -->
7 c* x, C5 v$ \( u1 `$ r+ }) K* W7 q& H y# ]* i
<?php% ]" m8 i$ o+ A& c$ m3 y c
break;
# K' [9 Z& l/ |1 ^# y& p- Pdefault;8 \% j4 H# A; L" t/ s' T
?>1 \+ t2 N9 j4 a- n: g
) w2 p$ j6 d: c4 n! P |: M
, I# k' l9 G% }* `6 S$ a6 t<?php; v. k) \5 {4 E$ ]$ x; w4 D" B
break; } ?>9 E( ^# I7 Z4 Z: K2 V/ W
/ x2 L# f8 X, n+ e4 ^<?php } ?>
: d- {9 M$ E6 ^$ N! a! `# d, L C8 f& a+ x
<p class="save-p">
* ?6 r2 r: u0 I<input name="save" type="submit" class="sbutton" value="Save Options" />/ U- d' p' u$ W- M" C2 d# k
<input type="hidden" name="action" value="save" />
) p7 U9 a, s. n( I( \0 _</p>
! G4 \8 y% R, [' h</form>7 Q( J% D q: }' g& u8 M; _5 b
/ t: T/ [- ^5 ?5 u
<form method="post">. B5 B1 m1 q0 s( Z5 d0 g% l7 L2 B
<p class="save-p">
6 u9 B9 D. t8 }<input name="reset" type="submit" class="sbutton" value="Reset Options" />
* y- _# A6 _2 U2 P- E% Y. j<input type="hidden" name="action" value="reset" />2 h N6 [* c* G0 n* B/ E
</p>
1 N7 J( L$ L9 J" [5 s0 G</form>
( B( a' u$ E+ I3 i; [( X2 W7 h
3 s# N: f- f- L% r</div><!-- ADMIN OPTIONS END -->2 ^4 k; M. H$ R: g
3 z! ^! W3 z0 w6 K8 J2 e5 x
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
! B4 A [/ b7 v, w0 q
; ?7 a. O- U! u/ efunction mytheme_admin_register() {, i# T0 Q, k$ p0 U. r' C7 o9 J+ }# ?
global $themename, $shortname, $options;
( h F. d8 a+ Y! w: [if ( $_GET['page'] == basename(__FILE__) ) {
& t* g$ Z# j: a) i% R8 b/ Gif ( 'save' == $_REQUEST['action'] ) {& j# S) d' }" c* Z0 m
foreach ($options as $value) {
6 M* r5 u% R7 f$ }3 c; D! f1 [update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
& H: o( J! O/ \3 F+ U& A% Dforeach ($options as $value) {/ }& A; X' `" e) i
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }- @: J$ f4 S; D6 B" H1 w
header("Location: themes.php?page=functions.php&saved=true");
: t5 _! S% o j( {* O# a3 ndie;
% i) s! g2 f4 a' H: ` B} else if( 'reset' == $_REQUEST['action'] ) {; q, ? }# G; e& ^! c* G
foreach ($options as $value) {% r, x) ?8 G: [" N/ x
delete_option( $value['id'] ); }
0 u3 u6 O6 @3 y6 ?, |header("Location: themes.php?page=functions.php&reset=true");
$ x F$ l* F7 J: pdie;8 ~! Y8 s. \( |5 o& X7 |
}7 E0 q8 R: P. e' M; h5 h o- `
}
7 y6 Q- W' F8 U' e/ f+ Madd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');# l2 ]; V$ V- |# b- U0 f+ h" N
}
5 C2 @! Q, `& {+ j7 w2 d/ A2 {7 S. {# h5 _0 e
function mytheme_admin_head() { ?>. e1 @( m+ h0 S
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />& ~/ ~1 t P. n: m: l6 n
<?php }( r, Q1 G$ H8 a
|
|