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