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