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