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