|
|

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