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