|
|

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