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