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