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