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