|
|

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