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