|
|

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