|
|

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