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