|
|

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