|
|

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