|
|

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