|
|

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