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