|
|

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