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