|
|

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