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