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