|
|

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