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