|
|

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