|
|

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