|
|

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