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