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