|
|

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