|
|

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