|
|

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