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