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