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