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