|
|

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