Web Developers, share some of your code snippets for others to use/see/learn from :)

Beau

Lifer
Jun 25, 2001
17,731
0
76
www.beauscott.com
Thought this might be a good place to start a code snippet sharing thread. If you have any unique pieces of code that you think others might find helpful (beit server or client side) post them here with a brief description of what they are. Also, if you're interested in making it a community projects, let me know. I've got a spare box sitting around with CVS on it and I'd be glad to start a small AT Repository of open source projects. Remember, the code you post must be your own.

I've got a few, but only one completely documented right now.

Project 1: Dynamic Cross-Browser compatible javascript drop down menus
Easily create/customize javascript drop down menus to any site. Uses CSS to style.


Coming soon: PHP Cross-DB/platform Database Objects, PHP Easy to use XML/XSLT based templating framework.
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
This can be used to hide block elements of HTML. Just use it with a link and it will toggle by its self.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
I've got quite a bit of ASP code lying around...if anyone is interested?
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,591
5
0
I am trying to figure out a simplistic way of building what a AT forum page looks like.

Object:
To create the equivalent of a spreadsheet that I can propicate values into using PHP.
Images are not needed, just text (possibly linked).
The way the AT forum pages look is what I am trying to get to. Without all the ad/banner areas.

I have not fouind a way to do this using the WYSIWYG editor tools.
The key may be the <div> tag; I am not sure.

=================================================================
I have a SQL database that I am reading.

The intention is to display the data fields that were selected.

Each selected field will be displayed in a defined column.
One row of data should be displayed per record.

I can not figure out how to position the data on the screen.

The way the AT forums is layed out with a title, replies, views, originator, etc is perfect for what I am trying to do.

I have the application written in VC but am trying to figure out how to port it where the info can be viewed from a web page.
=================================================================

Guidance appreciated.
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
Originally posted by: EagleKeeper
I am trying to figure out a simplistic way of building what a AT forum page looks like.

Object:
To create the equivalent of a spreadsheet that I can propicate values into using PHP.
Images are not needed, just text (possibly linked).
The way the AT forum pages look is what I am trying to get to. Without all the ad/banner areas.

I have not fouind a way to do this using the WYSIWYG editor tools.
The key may be the <div> tag; I am not sure.

=================================================================
I have a SQL database that I am reading.

The intention is to display the data fields that were selected.

Each selected field will be displayed in a defined column.
One row of data should be displayed per record.

I can not figure out how to position the data on the screen.

The way the AT forums is layed out with a title, replies, views, originator, etc is perfect for what I am trying to do.

I have the application written in VC but am trying to figure out how to port it where the info can be viewed from a web page.
=================================================================

Guidance appreciated.

You may need to edit it to suit your needs.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Anyone have a need for a scrolling status bar message or an hourglass in an ASP.Net page that's triggered by clicking a server control button?
 

LeetViet

Platinum Member
Mar 6, 2003
2,412
0
0
Originally posted by: amdfanboy
Originally posted by: LeetViet
Anyone got a simple PHP script that pings a certain port on an IP?

You can not ping a port. You can ping an IP using Text

So I can't ping say, 192.168.0.10:80 ?

Do you have a PHP script that pings an Ip then?
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: amdfanboy
Actually, I would like to see how to status bar thing is done.

First, you add these javascript functions to the .aspx file. If you are using VS.Net, you can do this in the html view of your page. Or you can just open the .aspx file in notepad and add them there.

<script language="javascript">
function MixInvVarianceClick()
{
SetCursor();
scrollit(100);
}

function MixPOVarianceClick()
{
SetCursor();
}

function SetCursor()
{
document.body.style.cursor = "wait";
}

function scrollit(seed)
{
var m1 = "Please Wait ";
var m2 = "..... Your Report is Being Processed ";
var m3 = "......This May Take a Minute";
var m4 = "";
var msg=m1+m2+m3+m4;
var out = " ";
var c = 1;
if (seed > 100)
{
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 &amp;&amp; seed > 0)
{
for (c=0 ; c < seed ; c++)
{
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0)
{
if (-seed < msg.length)
{
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else
{
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
</script>

Next, you have to tell the server control (in this case, it's a hyperlink control, but I think it could be anything) that it's supposed to call a javascript function when it's clicked. This is done by setting the attribute on the control. I do it in the Page_Load event.

These are the controls that I wanted to respond to the click event:

Protected WithEvents linkMixInvVariance As System.Web.UI.WebControls.HyperLink
Protected WithEvents linkPOVariance As System.Web.UI.WebControls.HyperLink

Then you just add this code to the Page_Load event in the aspx.vb file:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
linkMixInvVariance.Attributes("onclick") = "javascript: MixInvVarianceClick();"
linkPOVariance.Attributes("onclick") = "javascript: MixPOVarianceClick();"
End Sub

EDIT: oops, code attached is the same I listed above, I didn't realize I had attached it and I can't see any way to unattach it when I edit the post.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |