|
|

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