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