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