|
|

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