|
|

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