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