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