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