|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
; |6 L" _! M4 l// Theme Option
0 D; Z; q) F6 l1 |; T- o: x////////////////////////////////////////////////////////////////////////////////
7 t, J4 m: s6 K* m
; E( V# [/ ^- ~1 A$themename = "Zenx";
: k) u( \! W1 O0 e$shortname = str_replace(' ', '_', strtolower($themename));; k- \3 e, {7 `& ~$ ?$ O7 e/ a
$ d- ~& j, Q4 A& Q
function get_theme_option($option)
3 ~, j6 c+ Z& D9 L# m2 I a{
e# @! r4 n5 E* c4 k, P+ I0 a2 F global $shortname;
7 g+ a" I1 o" K1 ?: p# s return stripslashes(get_option($shortname . '_' . $option));) [$ p2 }9 ?' r& T0 p/ k8 c/ k
}
1 n/ n; x, ^- D- Q. U/ \( X1 o, J' [) N ]* m
function get_theme_settings($option)
! u1 {7 X( n7 x{
$ G8 d5 s, L* p! j! W& ?8 O, t) m return stripslashes(get_option($option));8 J' w7 h6 {) S, D/ U9 N- g; x$ D
}6 Q* I6 u+ ]2 }$ I1 X$ b
$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");7 V/ a7 f, [ @5 Y6 Q
$wp_getcat = array();* z: t0 }; e3 ^. \* @
foreach ($wp_dropdown_rd_admin as $category_list) {
6 l/ l* R# y! C& F- k$wp_getcat[$category_list->term_id] = $category_list->name;! k: k6 r) D2 U1 _/ o( W" I# e
}
# p$ X% u9 o' h6 D3 A* ^$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");+ K, Z! N7 c( e& |0 y' P* x: a
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
% D1 L2 v3 g. y% e+ s, U* B$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
+ s6 l/ d% ^3 ?8 F8 x& t4 z4 v5 e/ C9 O+ Z h- `
$options = array (+ r5 S+ C3 N7 M: ~+ N5 c
; V& [& [) Y2 G/ R* b
# v3 a. k' B. b6 j0 c o$ K# V
array( "name" => "Blog Header Settings",* a( q; l7 m/ J. y7 S" F! O5 y! p
"type" => "heading",
6 ~, R- @0 {/ H! @/ i; U ),! c$ G: G! Q# p4 ~) j- Z6 g4 g
6 _* _4 b7 G. u+ U. w$ O% R! c0 \! `+ ~ array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' q7 r7 e1 x6 ^9 o9 w2 s8 \9 _, Q
"id" => $shortname."_header_logo_activate",8 K( d' s5 d8 u+ ^6 c1 R
"type" => "select",( b$ E1 X k% C e. s
"std" => "No",
) T7 c9 b+ ^- V% h "options" => array("No", "Yes")),
6 R8 T, y7 Y7 p. d1 Q7 B7 D) o7 f
6 e0 A9 m( p! B$ i/ X' q array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
: W3 T! b! t, @; p2 x6 D* @3 {) Q9 m "id" => $shortname."_logo_url",4 R0 X7 h5 V4 t _ R
"type" => "text",% h- o$ @4 e7 Y: A7 q7 }
"box" => "social",( s+ D( ^0 |) [ u7 X2 Q
"std" => ""," ]7 R+ J- e! k
),
( Z6 Q% ~9 q' l& ? + ^% N/ G! u6 V ~+ z
array( "name" => "Insert Header Banner HTML Code (Header)
; K+ C; }6 n& H `9 f. p7 A <br /><em>*Recommended Size 468 x 60</em>3 j9 [: V! j+ {5 t
<br /><em>*leave blank if not use</em>",
! W0 c j7 R2 v' O "id" => $shortname."_header_banner",
) j, `4 m+ C3 `) r& O "type" => "textarea",
5 `/ e9 k% h# B "std" => "",. W F" t5 [' T! `2 w
),
9 s- e2 [6 i/ l/ p& W+ y3 b% X
array( "name" => "</div></div>",/ d# `( P5 C2 I4 ^5 ~ A$ r
"type" => "close", z, T8 @0 w/ x/ L9 Z
),
1 _) Y% t1 ~" N1 `2 s2 z
! C/ a& u- @1 J# A0 Z. u7 u7 o% h1 H# L% p. [. z
array( "name" => "Header Navigation Settings",
, Z4 `3 I1 c0 B "type" => "heading",# {* r/ {' `1 |7 ~6 g7 |0 |! G8 f
),1 l$ Y0 s6 X. y0 V/ c- o/ k
" L8 ^' R( Z- `$ Z1 [% B7 ? array( "name" => "Insert Page ID To Exclude On Header Navigation<br />6 k, e% E5 y4 H9 s
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />; C% T5 ?- U' l# L _$ n$ K9 I+ n4 s
<em>*Enter the page post ID number only</em><br />6 I! V0 H/ b2 i5 V6 F5 O
<em>*separate by comma</em><br />
/ ~7 T' D# @3 M/ Y" Z <em>*Exclude pages which you don't want to show on the header navigation</em>",
# \% y/ b3 v6 O, e. P "id" => $shortname."_header_page_navigation",, ?& K0 d$ z6 L) [+ v( j( q
"type" => "text",( x( p# C: \3 i e, {" k5 `. z
"std" => "",
) U3 Z7 |; t. B+ ?& } ),, G& u& v- S& y% K: J1 d
) |; ^% u) q8 c3 d7 q4 {
array( "name" => "</div></div>",
' J3 i+ V6 X- S9 \ "type" => "close",. d. T; r' t' z4 z& ? F
),
& _6 O9 ?& _# j4 J- C3 r1 D% W' L9 |' _
6 \2 [' @2 I, H' _8 z
: q7 r" F+ P3 V* f( g7 r# d array( "name" => "Post Auto Thumbnails Settings",
9 V+ w3 I$ w1 U9 b; E# N "type" => "heading",
6 X; e8 x# E# J* T, n9 R ),; p0 |9 U0 o/ c5 p0 c* _* a
r T$ J' J# _ W' {( L array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% n" u8 q& ~# k6 ^% g6 O$ _
"id" => $shortname."_timthumb_activate",3 f5 D8 I; ~- g9 I; }, L+ u
"type" => "select",
. `) T/ A( Z: Q5 u. ]2 J8 \% @ "std" => "No",
7 m6 _/ J6 B2 Z7 P: R "options" => array("No", "Yes")),
0 Z- ~; x! D: M8 }8 k' u" f : j: G4 e* @. u( D( R
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
! [4 N- `% F2 b8 H1 j "id" => $shortname."_timthumb_cropping",
2 O8 c$ ^; Z5 Y0 F "type" => "select",3 i# R7 [5 H6 J( R% o+ [" D, b* r0 p
"std" => "",
9 F5 M$ b" ~* ` "options" => $crop_position),
6 _! W& ^. H \9 k$ C3 |: c) E/ ^, P+ d+ s, p$ g2 d
array( "name" => "Insert Width Of Thumbnail Image<br />5 {7 c% p& h5 m) X. N
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />: g' [+ w( J, x
<em>*Leave Blank To Use Default: 250</em><br />",
0 h! h5 G3 d0 s# I0 e; ]& g( r "id" => $shortname."_thumb_width",
7 w2 \7 z0 v% }0 X$ A "type" => "text",
8 k: `: o% i! N8 | "std" => "",
& g2 l) \- w- J5 @% F ),
r2 \/ Y. Q0 j1 ^) W3 O8 G {( r" Z6 r! Z
array( "name" => "Insert Height Of Thumbnail Image<br />$ Q4 W% e' B5 p+ E6 B4 t
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />' I2 ^. }2 _1 p) M
<em>*Leave Blank To Use Default: 200</em><br />",! n/ g. m8 ?/ x
"id" => $shortname."_thumb_height",* F( {% z, [; h* Z6 G6 X
"type" => "text",
" _, ^( n$ N" g "std" => "",
6 \, `8 ?3 L: x+ p ),: Z& V' [5 E0 d/ d4 ~7 D
# t( p3 U0 G% p% }
array( "name" => "</div></div>",
+ k4 r! u, D- b) P' d( g "type" => "close",
) H: T1 }9 w; b, |% ~ ),
) Z1 e2 a: P% H8 L) g
8 |; H" q" r: \ I/ R; U( S array( "name" => "Featured Content Slider Settings",
5 p: ]# w) u/ Q4 Z6 X "type" => "heading",
& o' \2 M) m# ]" c/ \ ),
$ D9 H# R4 g5 W9 U$ b8 J% a4 E; a( Z
# l, R' n+ D: {$ }3 E! \ array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 j3 d( k* h+ w+ R3 m "id" => $shortname."_featured_activate",
6 t* L: G, Y2 L: r9 k0 R) M "type" => "select",6 J: w1 B7 C6 ^* T
"std" => "No",/ y- j" I7 B+ y- k! x" a' l) ?( y% I
"options" => array("No", "Yes")),
1 T# x; j' j$ y* r+ e" Y6 [2 Y# }$ A& O! q
7 K' n3 r' d# i$ e) D( C array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
9 m7 Y) Y/ ^, s! W+ a$ M1 O) U* ? "id" => $shortname."_featured_category",
$ k& w* J) ^. `! U! `0 E. O0 O' u "type" => "select",
9 l2 E% [4 p4 h1 t+ s' \. C "std" => "Choose a category:",
+ q' P8 s! F$ C5 x, p5 | "options" => $wp_getcat),, _' p% S/ H! A" C
( h' u, e# G, k% q$ Q+ c4 D' H
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",. V9 A& c4 |8 `; [
"id" => $shortname."_featured_number",
^/ t& k; F M& [: N "type" => "select",( @3 n: _2 ]8 ^3 ]/ H9 v: m8 _0 Y
"std" => "Number of post:",2 x2 }1 ]% M" r5 a/ ?
"options" => $number_entries),
6 ~# ?6 t7 |1 v: b
2 {! s/ g9 \0 [/ j6 j' o+ G: G array( "name" => "</div></div>",
" C: H* ]1 |( `4 r1 ^ "type" => "close",
$ ^. y- I6 ~8 D. q- F ),1 q6 ~4 t3 M# ~3 w- l
1 k# b: n# K" o( u; N
array( "name" => "Featured Category Settings",3 C( w# T" k% w. j- T! r
"type" => "heading",% u5 D) k. l1 R7 Y
),2 ^9 C# e1 `3 h' \* F6 [
0 F$ _% V% X& D( q6 \% s1 J array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
+ h) T# @5 B. P5 h: o* z$ m "id" => $shortname."_featured_category_activate",4 O$ s x5 c; m. `' h( {
"type" => "select",; W- ^2 f% x% T, P1 x
"std" => "No",
' k3 k+ j* q" [. m# { "options" => array("No", "Yes")),
( `: ]) F, \% r1 ?
8 G. C8 B$ A. x% C0 t array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
! b2 v; g/ h8 j1 I6 T: }* g. g6 s "id" => $shortname."_featured_category_id1",. o! e: e1 I' Q2 W' N* X- O
"type" => "select",! X0 T+ @: V* T
"std" => "Choose a category:",& x- W: P j1 F+ F1 {
"options" => $wp_getcat),
5 ^/ ^6 w b4 k) o* o * l- Q! F9 W' j- X* }: X
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",( n: D5 o, h% Z
"id" => $shortname."_featured_number1",5 I- d/ N$ C1 {2 P/ _
"type" => "select",
# `6 I3 D# \7 x \6 [! J& [" F "std" => "Number of post:",$ V& g2 `( [( E! B: C
"options" => $number_entries),
- X7 T; @+ M$ b. E3 W
8 _2 [3 ~" t1 ^; Q$ y- e2 S1 I# x array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
1 g' \& i( g: k& x% r1 p "id" => $shortname."_featured_category_id2",9 k; U: D, u9 A$ ]6 L1 f
"type" => "select",
! F3 Z2 r+ w6 J' x! n! w "std" => "Choose a category:",6 x. Q7 L: ^7 ^0 m; `
"options" => $wp_getcat),; E, v4 M! z& W7 T" ]5 E1 Q b
8 c8 L; N4 p% K7 M% m array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",# S s% j6 T6 ?" _/ k' i% z& v* M
"id" => $shortname."_featured_number2",
" G$ Y5 G7 {/ o6 F "type" => "select",- s& m) B: v5 {% D" V/ F0 a
"std" => "Number of post:",7 Z8 e$ ]9 _, \ W1 X5 G
"options" => $number_entries)," v' N4 P1 p x- X9 c* U
) R$ l) ]5 e0 q" n/ f
1 @$ H! @" D6 x& F array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",4 p: G: A! f( t9 H
"id" => $shortname."_featured_category_id3",/ x1 [3 D0 {& {3 C, v. _+ a
"type" => "select",& Y( _+ `3 @; @; u; K
"std" => "Choose a category:",7 ?+ G3 ?7 c: p
"options" => $wp_getcat),
8 J! c! e: y# Z8 Y9 } 4 W& f% t% I+ l; ~
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
, k' P/ g) D8 X0 o "id" => $shortname."_featured_number3",
1 M6 E% G4 q) b/ I6 d- Z6 r- x "type" => "select",
/ u4 v2 ^5 D8 C6 V B6 x "std" => "Number of post:",+ ?; ^. B2 g, c) J+ e
"options" => $number_entries),
# C2 v5 h+ V+ `8 E
' V, w1 O b O9 m' V8 x4 S
% m* U/ |# g, W/ K& W array( "name" => "</div></div>",) `! `* Q' u" _- ~; X( ?- g
"type" => "close",, _( R8 ^$ C, m: C0 |3 c# ]
),
4 \) h ?2 u) v5 d7 a
# S+ I! P# {: s+ V( o8 H/ n% h7 u A$ |% f* I
array( "name" => "Google Adsense & Analytics Settings",7 ^$ l- F$ W+ |& R' Y6 L8 W/ `
"type" => "heading",
5 ]; y U( c7 u+ L$ ?' j- o( L2 t ), T, d# K3 r+ A" ?
6 k! W7 X4 i* v3 b* l# A
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",/ C' ]8 v5 s# d* T+ U5 F
"id" => $shortname."_adsense_loop_activate",
5 I) t/ Z+ v( T4 v5 B3 _. ~ "type" => "select",/ t' f0 U6 S0 r# p3 R- c( L
"std" => "Disable",2 u! I! u! E5 _9 L" b; @8 F
"options" => array("Disable", "Enable")),3 `. B R u: w5 z
. }# G; e! E( G" D: l6 d
array( "name" => "Insert Google Adsense Code For Loops Here<br />% R+ h/ B: U9 G s7 j
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",( @( q0 c9 Z% \0 A. d
"id" => $shortname."_adsense_loop",
& |$ O: @& v- n* Z5 f0 x "type" => "textarea",+ f; w# z: }# }7 r0 q3 N' G
"std" => "",9 M" s. B# v% q8 Y: l1 o% ?0 s
),/ M4 M! n' @5 N. p, _: a1 x
/ ~: |, k% [# ?- y array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
- F# I1 a8 C- K8 m2 n "id" => $shortname."_adsense_single_activate",
) |6 B" \* o8 d* ]+ T2 N+ F" C P2 a& [ "type" => "select",
7 i- \+ U5 a- u. k6 Q$ ~ "std" => "Disable",
* S2 i# o! d# W1 j0 d' T# _ "options" => array("Disable", "Enable")), Z4 a, g" h& X
5 b, j T1 \# j- t- T+ n
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
3 R5 P4 Q4 V3 K! q5 I+ p <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
- k0 r! G- J$ {* j "id" => $shortname."_adsense_single",
5 y4 w4 A- b* L) Z& g6 n "type" => "textarea",
7 c" J4 c o; t! N "std" => "",9 U0 y9 a1 B/ v0 \9 B# @
)," U8 E& q0 Q" d7 N! Y& a/ D
2 B3 E0 Y2 Q" G- G
9 X- {$ h4 U( w/ h( y array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",2 P5 S! l5 S# A! y8 X$ d
"id" => $shortname."_google_analytics",0 D1 s. n9 ~# W+ e: I$ W2 }* `
"type" => "textarea",+ L1 U2 V. J" N. V% x5 V
"std" => "",
& V) ^4 W. T# H7 O9 R" m ),' W* d g) X8 h4 C0 Y* q: {; @' s' C7 ~
: }+ P* j1 M3 a+ \0 S array( "name" => "</div></div>",: W9 x) p6 e) G8 M, Y
"type" => "close", w, j) y4 w7 c- M
),) ~" [% ]" B8 |( }
# g5 o7 U" v1 y$ _- t
8 f/ m2 t# U! _7 a' z: y array( "name" => "AddThis Social Bookmarking Settings",; f% t O/ r: r2 y9 y
"type" => "heading",# p. N: |6 R3 S, s* f' I0 }* m- K
),
* D, O( t- |7 P) R9 t" P9 r" }# K% r4 K' ]
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
) j1 P" M& l$ G1 I4 ~; }/ ^ <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",* ]. }/ C; K4 K( Q, \( l
"id" => $shortname."_addthis",
( T# {, }1 V. {0 d "type" => "text",
, V l0 }! _5 ]* O" i7 {2 l, h$ ] "box" => "social",& S/ F" a. `% L$ K/ U F( m2 m4 a
"std" => "",: d% K" ?8 p! H& @) z( H
),
# S+ n! y: }1 ?0 |. _/ R& U* q8 @% h7 K# ?4 m9 @
array( "name" => "</div></div>",
! J- v8 T+ V0 U( [ "type" => "close",8 t, t+ Q0 d t% o: \, s
),4 J% \6 v. |' X$ i7 z6 |
9 J( h! w8 v, d) I
" `5 A- `; E ~
) Q( J5 L5 e) V: ` array( "name" => "YouTube Video Settings",
% ?6 {: e+ \7 ~5 @: z k" i4 d5 R "type" => "heading",
P: B, ~: \% }: ~9 A$ e2 R ),* r' M4 [+ p' C. @% l. \0 T" G
j( J. y% }6 w0 D array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# m0 F( h6 g. w2 k
"id" => $shortname."_emvideo_activate",) d5 `. t, H7 D; C6 A$ }# o
"type" => "select",8 e# B' S1 ]2 q9 C/ r
"std" => "No",
$ M2 f! a; m5 D! U- f "options" => array("No", "Yes")),6 ~: R, { i3 J
# ]" R" C. }& S8 G+ U
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>",3 D" m% X; z, L. _9 d& T: f7 t
"id" => $shortname."_emvideo",
2 Z8 w3 Y2 n' o8 _5 \ "std" => "",
6 ]& }% O/ T: q% d "type" => "text"),$ V. |2 w" T6 Q* U7 L! d
& Y& h' y, \ p8 P# |
array( "name" => "</div></div>",8 g. T2 q8 Z0 M+ _4 F0 E
"type" => "close",7 `0 M M0 y! Q# v" D- k
),
8 D) N' k, b5 V R+ T' \9 V : C- ]+ K0 _/ X w A% _
array( "name" => "Twitter Settings",
6 N2 d" b. @7 `- A! i "type" => "heading",2 g& s9 F/ R1 G: |( t# h( N
),, T7 Q+ C4 a, K
# o; s# J, j# m- @3 |
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 D* i$ E9 s( u4 B0 O7 o
"id" => $shortname."_twitter_activate",
* }" W! o2 X; s9 h "type" => "select",0 b1 }. n/ g' z1 ~" @5 B) d9 z+ a
"std" => "No",
+ T" M4 ^3 x1 G v+ o$ c/ ~/ y$ s "options" => array("No", "Yes")),4 Z r5 M# M6 O3 e+ {% M
$ f( q3 J2 q4 G" W7 @
array( "name" => "Insert Your Twitter ID here3 i, V& {1 z/ @( V: _
<br /><em>*leave blank if not necessary</em>
. T1 J; S. Y' i <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
7 E! L) K. z" M" @ q "id" => $shortname."_twitter",
/ J, D! J q$ ~+ s" S2 O "type" => "text",
' |. Z4 o8 h' d& z2 p "box" => "social",1 ]3 q( h7 W" y( L
"std" => "",
1 _9 h; H% H4 B) T. W$ P! h ),) v3 e$ Q2 b. @% g" l+ v
9 `6 p" q9 @% d. ^; }
array( "name" => "Enter Twitter Feed Count here
9 g" H0 d# a- _# c6 |8 L* _ <br /><em>*leave blank if not necessary</em>
5 h3 X& c; N3 w/ v( A: Q1 w <br /><em>*Enter How Many Twitter Feed To Display</em>",' B! C. O0 g' S
"id" => $shortname."_twitter_count",
4 E* E# n) Y) T; I "type" => "text",
) p3 i% }8 a7 B2 N8 D* X "box" => "social",
T3 Z6 o8 J# H2 N' O" W% q "std" => "",' q7 d7 M# U1 Q; Y" s& q& w
),! K5 x0 X. t$ h) G* D1 ?$ t7 k
0 O. H, r0 j, f array( "name" => "</div></div>",- F+ A: @4 Q3 u" w$ z" ^" a
"type" => "close",
# P, t1 ^1 L& @ ),9 v* T% R t( K# b. I
* S C# ?/ p s% f: b! M1 E
( U+ O, i8 C$ V9 F
array( "name" => "125 x 125 Banners Advertisement Settings",, @5 _' D2 `- Y8 p0 D1 b
"type" => "heading",7 T9 h( A) E. J4 g
),
4 O4 i) w- ]: C& ^ + R, c G+ d5 c7 A& D. r
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 k/ ]% s1 g! i% T5 L# j+ T5 t "id" => $shortname."_sponsor_activate",/ N8 D5 n5 T, R' J$ j: ]
"type" => "select",* W E/ q- t8 b4 m2 o% r
"std" => "No",8 ~: @, Z0 P6 F0 F T
"options" => array("No", "Yes")),$ P3 K9 y3 r) O1 _0 v
, _9 k. @) m) r& Z/ _# [
4 k) e1 ?3 K! `0 W, [ array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",7 l* t6 A! [* ~+ t0 V" e) |; v
"id" => $shortname."_sponsor_banner_one",
+ u' P7 H! J! r( N/ [ "type" => "textarea",' A$ ^+ ]; [/ t) r9 v6 D
"std" => "",3 M$ i' g& H2 L" R% I4 P( z0 I
),
$ k( I ^ s$ F+ u2 H
Q6 J4 _) X) A9 ^ ]2 y% B array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",$ h4 d% i5 l! Y( R
"id" => $shortname."_sponsor_banner_two", ? C4 G4 F3 {9 F) o
"type" => "textarea",
" ` @5 z: U2 m1 K+ k "std" => "",
# W" i0 f3 j& a) @1 o& y, U; c ),
" V$ v. h* m) i6 L/ B( X2 c$ Q: D5 F
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
# x' G1 a# M4 H, W4 t$ ` "id" => $shortname."_sponsor_banner_three",. A# R3 @: u: j- ?) B" K
"type" => "textarea", N8 m$ n. p1 x, i4 O# j+ q# {
"std" => ""," y" d4 h) B w7 }# y
),( D, ^/ x" w* ~3 Q
/ d$ A. v9 p' |5 g/ ] array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",6 V9 T% W: H r; Y
"id" => $shortname."_sponsor_banner_four",
- v4 l2 p r& `& Y% k% b# v "type" => "textarea",
. R: W( d1 U* E3 r "std" => "",
0 D/ T1 V0 q& B, G2 L ),( H4 U0 @4 Z) }2 \
6 F+ v$ W2 d# _& c: Y# N, n, d7 N array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
4 ^! }; j% b8 [% J( D, H7 \' X "id" => $shortname."_sponsor_banner_five",3 ]5 g, S& ` G7 S# V/ U1 W
"type" => "textarea",, b/ ^# }. @8 t8 U
"std" => "",; ?% @4 k% \& n N! N. I
),5 O; Q: ~7 o# ^6 ?7 G4 Z; B
. ]# F+ {. e9 L( m array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>"," y1 s; T1 x& x. k# k5 y
"id" => $shortname."_sponsor_banner_six",
' c+ u, _& T0 a "type" => "textarea",
% c' q" `/ Q5 o W9 z "std" => "",+ O6 [" A: f$ H2 B' A9 h" E
),1 b3 @) s3 W; A0 U' h' t
3 [- I8 Y$ J7 f% A4 c6 i
array( "name" => "</div></div>",* L9 d$ L3 D$ U9 N& H% q2 ]3 ?
"type" => "close",
w8 S/ V. _* ?( A! G1 z9 Q- u j ),3 f6 v% E0 O* ~4 y2 k# x0 |
) o: b8 P$ `7 x$ J
9 O% g+ u$ D; L0 F, k3 }! [
) X" }$ `6 Y1 b$ W3 O% \);
8 l$ S/ R) a% N! _6 J# ?6 i# L! }, N- C) L$ B! z
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
5 b0 m8 S' [% P8 D" A7 T) x9 B$ M8 J- N
echo "<div id=\"admin-options\"> ";1 K1 V% N2 G0 `: |8 C" j
: S3 O+ k; h/ W, F3 G h( Dglobal $themename, $shortname, $options;! A/ P8 D/ A: n& ~: f0 [1 Y0 m( r
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
- A/ ~3 ?$ m4 ^% L/ v' @& I2 Sif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';. V/ T6 W4 e N$ T' N8 a) b, s, U
?>
3 w* p$ _( K: P0 b, S& h& z9 S
1 U6 |! c; e2 D2 M5 r! `& T<h4><?php echo "$themename"; ?> Theme Options</h4>
. G5 Q5 P$ N8 z4 e; q* y/ V! D+ d; c4 T4 U
<div class="annouce">
5 {' P6 i: }2 @( `<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>& T/ V5 f0 J0 k9 f6 c+ I
<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>: |, ]4 g- V0 Z
</div>
: ^' Z9 w2 W6 U2 R4 i7 \ x: D- L' h. J, b! p- M/ `
<form action="" method="post">* M: a) B; c0 e/ i/ o
$ T; k) q5 T. c p( t
<?php foreach ($options as $value) { ?># h/ _3 m& M7 Q0 C3 i
1 n2 Z1 h4 `+ o" e& w0 |<?php switch ( $value['type'] ) { case 'heading': ?>
% J- y0 Z/ i, Y9 B% j$ h5 E" X8 y* J% z1 j; p
<div class="get-option">6 T) N, r% D: Z+ h. G
: K, M% |& Q6 J( L! Q/ u
<h2><?php echo $value['name']; ?></h2>
% c7 G- k/ ^# q$ g! }6 j& F* d% ]9 R) D3 f
<div class="option-save">
, f2 X# W3 r& l$ Q; V6 X
5 H# R2 s1 h9 E. {$ P" w2 [<?php" P# m1 u% R! k
break;
2 P% Q" y7 h! C8 _. p- ^case 'text':
) U5 Z8 W! I' o2 U, o?>
# f+ u# ?' s. t% d" [# p# f5 X. I9 h/ f1 j# v, o( E" ^: Q5 \; ^+ q G
<div class="description"><?php echo $value['name']; ?></div> N( `5 [+ I; C P& X
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
) S5 i& E0 J/ p
6 J) g. f& C- b) l( Yget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
" L( n- H. [& m; P( F1 h; Y. c/ o$ N+ P( Z* c
<?php
- ]8 A Y, n ~) i3 Kbreak;
4 b4 r5 L% o5 |3 jcase 'select':
( w5 z* H9 H! R5 h?>& V/ o( d% s$ T* X; Z% r8 }
, _( R% F; \3 Y( Q<div class="description"><?php echo $value['name']; ?></div>
# r, T: ?* U; q& H0 }" c<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">* q1 s6 c# o' ?# ~
<?php foreach ($value['options'] as $option) { ?>4 I" }! w; ]9 ~" v
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
; Q3 V2 q) ]9 g5 p1 I) t' P4 O1 r<?php } ?>$ w0 t1 M& [8 q2 G% ~; f+ Q( @* t C- h
</select>) W. I3 L; o. f8 c ]# y1 b
</p>
! J v6 L2 t* R
( q) m6 j" F8 v* |, [; x7 a<?php7 c3 B( h1 P* J
break;
$ x' C" A9 ?) N8 t6 [6 q0 L; ?3 fcase 'textarea':
8 F+ M0 O& I: @' s% [3 Y$valuex = $value['id'];4 T3 r7 D/ g1 x( E: e# Y
$valuey = stripslashes($valuex);
9 O' W6 X; t7 {: I$video_code = get_settings($valuey);# U& V$ a) d$ q0 u6 ]
?>
C% ]: a R$ y; } V0 A' o
! \2 Z* ]" W( T0 p: p; d<div class="description"><?php echo $value['name']; ?></div>
/ m: z; P" o2 \5 P/ I% X+ U) a<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
3 G. I+ J' K; O; Q: \
0 V, b1 ?( q( `6 P! Q4 M: belse { echo $value['std']; } ?></textarea></p>% O7 a- X0 l) c& r
2 O$ m% P# S7 b/ f, H, k0 d+ [0 p! \9 |6 J<?php
, H. U, z4 h% d* x' \break;# v' e5 X4 j! r" J7 p* G* `! s
case 'close':
6 {3 Q$ y* }/ R x+ \?>
. @' w5 S, X9 j' ^6 k$ W! I8 V- N7 m( f# E. b- \" s0 {
<div class="clearfix"></div>
& `7 e& [) |) B. I( G3 j, B' s- M</div><!-- OPTION SAVE END -->7 M* N N9 ^5 Z$ C" s$ I. r- z7 T
" u, n; ^3 I4 I3 r
<div class="clearfix"></div>* e6 e. k8 b# P# i
</div><!-- GET OPTION END -->: m- D2 _, x- J+ R
) ]% \% ^5 d( M<?php+ Q( h, `) T- I: Z
break;5 u. h4 V7 [; k0 H
default;
; B( e6 w. n6 a! ]. C7 E/ U?>
- \0 J9 N7 M1 H, k1 i7 v
; ^5 p8 r( K1 m; K" j, h8 r5 F2 M. x' V
<?php9 Y0 E! y. }/ r
break; } ?>
# [/ k9 U& n* G$ y' s4 r8 { S1 l! t
3 e& }2 @% \1 Z% E! T! g7 q<?php } ?>
L) v$ }* C& z7 i, m2 a0 l% o' w3 }* l6 e. V& ~
<p class="save-p">! M3 c( K2 p* N( I0 u
<input name="save" type="submit" class="sbutton" value="Save Options" />9 }" X6 i0 c- T6 [" M. l0 B
<input type="hidden" name="action" value="save" />7 o# h- s8 G, v7 L
</p>: C3 t. g# @ E" e
</form>
$ z+ p W: e0 @1 x8 ^2 w+ ]
1 c; t( q' g/ S# q<form method="post">
" P7 E) D: i4 H4 R4 N<p class="save-p">
& F+ c. ^3 y/ J, A5 @6 u<input name="reset" type="submit" class="sbutton" value="Reset Options" />! \. p2 k# k) c% N A' R
<input type="hidden" name="action" value="reset" />
r- z7 Z8 u8 d2 V2 E+ k</p>: F' q0 O& G a# M
</form>
% e& M5 a3 \4 h, i2 G4 d: T# [. T( W7 K
</div><!-- ADMIN OPTIONS END -->) n, c& j5 a! b, E
# q, O5 V8 G. p/ j- `( z<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
$ e" O- Y8 s0 v" K+ r1 Z# v u9 ?
6 V7 p! y. Q5 d* ?2 wfunction mytheme_admin_register() {) \' @* |3 J4 m8 T5 b1 K7 T G
global $themename, $shortname, $options;
; T& \# i8 r S3 {- i: yif ( $_GET['page'] == basename(__FILE__) ) {
' q; m8 F) k3 ~1 y5 P4 y# o4 b* t& Pif ( 'save' == $_REQUEST['action'] ) {
! \! |- y+ U( Hforeach ($options as $value) {
' a1 o2 o" i1 ~. C) e( d Kupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }6 z% F9 n0 o0 T0 [+ \0 L- N
foreach ($options as $value) {
0 f$ [% A5 N/ E/ Rif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }& ~ E/ x6 X' w4 m: f
header("Location: themes.php?page=functions.php&saved=true");5 C! r: C3 A2 a7 i: P: R+ Q
die;) W- _1 Y0 H3 x0 r( I' e0 h
} else if( 'reset' == $_REQUEST['action'] ) {
! B- X6 N& f) x hforeach ($options as $value) {0 ~" r4 s: s2 B# x
delete_option( $value['id'] ); }
% T4 W0 n# J: M# c# X( n$ V& Gheader("Location: themes.php?page=functions.php&reset=true");0 |& e, ]5 J( y8 B" J2 \9 Q
die;' w: _( L( p& W
}
- x; g4 z9 B, T1 ] Z$ S}
5 u# M/ V9 q- p6 ladd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
6 G! c0 Z6 E; p}
4 ?5 O: _( s7 {6 {: y4 m- {7 e
$ e! V4 h( u+ q5 W: Dfunction mytheme_admin_head() { ?>
2 R# N6 a9 b0 f- J; v8 j<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />9 A5 R+ _& q* `/ I
<?php }3 \' q! k1 d( m$ U% h6 W
|
|