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