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