|
|

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