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