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