|
|

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