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