|
|

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