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