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