|
|

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