|
|

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