|
|

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