|
|

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