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