|
|

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