Shoutbox Mod
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=24034
Printed Date: 29 March 2026 at 12:33pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Shoutbox Mod
Posted By: shemzilla
Subject: Shoutbox Mod
Date Posted: 02 August 2007 at 1:00pm
here's a simple shoutbox mod...
Bugs Fixed: 1. html characters removed, also limited to 300 chars per shout 2. member profile link fixed
Just dload the zip again and replace BOTH files
Add files to main forum folder: http://bikecrazy.jghinternet.co.za/Shoutbox.zip - http://bikecrazy.jghinternet.co.za/Shoutbox.zip
Add this to default.asp: add it to where ever you'd like it to show
<!-- SHOUTBOX --> <table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger"> <td>Shoutbox</td> </tr> <tr class="tableRow"> <td class="tableRow"><iFrame ID="IFrame1" src="shoutBox.asp" style="width:100%;" SCROLLING="auto" frameborder="0"></iFrame></td> </tr> <tr class="tableRow"> <%If lngLoggedInUserID = 2 Then%> <td><b>Please login to use the shoutbox</b></td> <%Else%> <td> <form name="frmAddShout" action="addShout.asp" method="post"> <input type="text" id="txtShout" name="txtShout" class="text" style="width:350px;" /> <input type="submit" value="Shout!" class="smText"/> </form> </td> <%End If%> </tr>
</table> <!-- SHOUTBOX END -->
|
Add this table to your db:
CREATE TABLE [dbo].[tblShouts]( [Shout_ID] [int] IDENTITY(1,1) NOT NULL, [Author_ID] [int] NULL, [Shout_Msg] [varchar](500) NULL, [Shout_Time] [datetime] NULL CONSTRAINT [DF_tblShouts_Shout_Time] DEFAULT (getdate()) ) ON [PRIMARY]
GO
|
there ya go 
look, i've quickly run through this i think that's everything, shout if you have any problems.
this is very straight forward though, so make sure you uploaded the files and added the table before saying it doesn't work ;), it works 100% on my site Shem
|
Replies:
Posted By: iSec
Date Posted: 02 August 2007 at 4:02pm
|
I do not want to modify the database, can we create an independent database?
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: Scotty32
Date Posted: 02 August 2007 at 8:14pm
based on the PM you sent me, using WWF database would be the best idea in my opinion.
just name them with a prefix like "SBMod_" to avoid future problems
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: javi712
Date Posted: 02 August 2007 at 8:29pm
Posted By: iSec
Date Posted: 03 August 2007 at 6:07am
|
Shemzilla, you have done a very neat mod. Thank you.
Scotty thanks for the advise... I took it and I guess i can delete that one table whenever I want, especially that I have complete control over my server.
There was one bug though: when someone clicks the username it takes them to the main homepage of the website, for example: http://www.domain-name.com/member_profile.asp?PF=1 - www.domain-name.com/member_profile.asp?PF=1
it should have the forum directory after the domain name.
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: iSec
Date Posted: 03 August 2007 at 6:30am
|
Security issue:
This mod allows for the excution of HTML... this is a huge security issue; can it be limited to allow only Forum BBCodes?
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 6:57am
@Info_Tech
ooops thanks for pointing that out, i'll add some validation;)
Shem
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 6:59am
about the pointing of member_control_panel.asp i'll fix that up too;)
Shem
|
Posted By: iSec
Date Posted: 03 August 2007 at 7:27am
|
Another bug that makes this mod useless:
When another member posts a shout, you will not see it until you refresh the page! Would you be able to fix that?
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 7:56am
info_Tech
fixed your previous 2 bugs, just test it please....
and as for it being useles because you can't see another shout before refreshing, then i guess this forums is useless too, as you have to refresh to see a post???
also consider the fact that while your typing a shout and the bloody thing refreshes and you have to retype...
|
Posted By: iSec
Date Posted: 03 August 2007 at 8:01am
shemzilla wrote:
and as for it being useles because you can't see another shout before refreshing, then i guess this forums is useless too, as you have to refresh to see a post??? |
A shout box is a different add on. It has to use some technique to display other members' shouts withOUT refreshing the page. I have seen it on PHP forums... i dont know how they do it..im guessing they use AJAX.
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 8:05am
aspfree is a huge asp community and i've based this shoutbox on theirs..
i'll look into it, remeber tho' it's a shout box not a chat client, it's for leaving a quick message for your mates, instead of going and making threads.
but anywho, i'll look into it 
Shem
|
Posted By: iSec
Date Posted: 03 August 2007 at 8:14am
|
Shem, i appreciate the hard work and for helping on this...
however I disagree that it is just for leaving a message. If it was just to leave a message then why not just use the forum !? or maybe use the PM system?
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 8:23am
cool no worries  got some new features lined up for it too
a shoutbox leaderboard, ppl can see who has the most shouts 
Shem
|
Posted By: Scotty32
Date Posted: 03 August 2007 at 12:44pm
shemzilla - add a meta refresh to the iFrame but dont have it refreshing TO quick.
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 12:58pm
will that force a old school refresh? gona try your solution, but will prob go with ajax.
Thanks Shemzilla
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 1:01pm
Scotty32 wrote:
shemzilla - add a meta refresh to the iFrame but dont have it refreshing TO quick.
|
gona go with an ajax solution 
Shemzilla
|
Posted By: freakyfred
Date Posted: 03 August 2007 at 1:17pm
Info_Tech wrote:
Shem, i appreciate the hard work and for helping on this...
however I disagree that it is just for leaving a message. If it was just to leave a message then why not just use the forum !? or maybe use the PM system?
|
Maybe you could come up with something better rather than slating this blokes hard work. Not really fair to sit there and call it useless.
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 1:40pm
too true freakyfred, if ya don't like it, don't use it..  also criticism is good, helps to make mods better.. 
cheers anyways freakyfred  Shemzilla
|
Posted By: Mikey
Date Posted: 03 August 2007 at 1:58pm
Without constructive criticism nothing would ever improve
------------- Handyman man?
|
Posted By: iSec
Date Posted: 03 August 2007 at 2:28pm
freakyfred wrote:
Maybe you could come up with something better rather than slating this blokes hard work. Not really fair to sit there and call it useless.
|
Freakyfred, thanks for the input but we're not minors, we're professionals. I was just telling the fact that this mod will not be used in its current condition, and to make it a useable mod i can't just shut up... Let me also quote Mikey's reply for you:
Mikey wrote:
Without constructive criticism nothing would ever improve |
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 2:40pm
ok everyone, enuff cr@p!!
everyone has an opinion, some have tact some don't, at the end of the day, whoever likes it will use it and vice versa.
I don't care what anyone thinks of it, i'm just contributing.
Shem
|
Posted By: javi712
Date Posted: 03 August 2007 at 2:57pm
Well, I like it!
Shemzilla, can you let us know when you have an updated version so I can download :)
Thanks for your hard work on this!
|
Posted By: shemzilla
Date Posted: 03 August 2007 at 3:09pm
There is allready an updated version, fixing 2 bugs.. but the ajax refreshing has not yet been added, though it's not the end of the world either, it still performs 
will get to adding an ajax refresh soon, busy with more mods 
Shemzilla
|
Posted By: drizzt001
Date Posted: 31 August 2007 at 9:53am
|
Hello!
I have installed this mod yesterday, and well my users love it!
I hope this "Autorefresh" thing will be implemented soon...now its working as a msg. Board...but it would be great to have it as Shoutbox/Chat
Can anyone tell me, when the entrys of the shoutbox are cleared or is the box containing and keeping all the msg. ever written ?
Would be great to have it cleared all 48-72 hours
Regards
Mike
|
Posted By: dj air
Date Posted: 31 August 2007 at 10:06am
just looking at the main page of this MOD
instead of using a database i would have used a application Array thats stored within an application Veriable on the server, this would save the DB hits.,
|
Posted By: drizzt001
Date Posted: 31 August 2007 at 10:12am
|
well i hope the creator will update this sooner or later.
I really love this mod. And if it will really work with autorefresh it would be a class add. for every webwiz forum 
|
Posted By: spider975
Date Posted: 31 August 2007 at 11:26am
|
can you give me a link of implementation?
thanks
------------- "random notes from an Italian IT professional"
http://blogs.sysadmin.it/stefano - http://blogs.sysadmin.it/stefano
|
Posted By: shemzilla
Date Posted: 31 August 2007 at 1:30pm
dj air wrote:
just looking at the main page of this MOD
instead of using a database i would have used a application Array thats stored within an application Veriable on the server, this would save the DB hits.,
|
never had a problem with doing it this way, but your more than welcome to change the code and make a version using an application array
Shem
|
Posted By: shemzilla
Date Posted: 31 August 2007 at 1:34pm
drizzt001 wrote:
Hello!
I have installed this mod yesterday, and well my users love it!
I hope this "Autorefresh" thing will be implemented soon...now its working as a msg. Board...but it would be great to have it as Shoutbox/Chat
Can anyone tell me, when the entrys of the shoutbox are cleared or is the box containing and keeping all the msg. ever written ?
Would be great to have it cleared all 48-72 hours
Regards
Mike |
Glad you like the mod as for auto refresh, I haven't even started on that work is crazy at the moment and i'm still trying to finish my community site with my spare time, sorry, but for a quick fix you can do what Scotty suggested "add a meta refresh to the iFrame but dont have it refreshing TO quick" so basically just add that meta refresh to your shoutbox.asp and set the amount of seconds to refresh, make it like 7 secs
entry's are all saved in the db, this is needed as i'll be adding a shoutbox leaderboard to the mod soon.
Shem
|
Posted By: shemzilla
Date Posted: 31 August 2007 at 1:35pm
spider975 wrote:
can you give me a link of implementation?
thanks |
go to the first page of this thread, it's all there.
Shem
|
Posted By: spider975
Date Posted: 31 August 2007 at 1:39pm
|
oh sorry,
I wanted link of some forum with this mod!
sorry for my bad english!
:-)
------------- "random notes from an Italian IT professional"
http://blogs.sysadmin.it/stefano - http://blogs.sysadmin.it/stefano
|
Posted By: drizzt001
Date Posted: 31 August 2007 at 2:58pm
Hi Shem!
Thank you for the reply - no hurry, just good to see the creator of the Mod is still around. I will keep it as a msg./pin Board for the moment. And whenever you finish it i will implement it then 
ps. great mod!
|
Posted By: chong67
Date Posted: 31 August 2007 at 5:11pm
|
What is this mod?
Where to see a demo of it?
|
Posted By: shemzilla
Date Posted: 02 September 2007 at 11:29am
for a demo go to: bikecrazy.jghinternet.co.za
unfortunately you'll have to register to use it
Shem
|
Posted By: shemzilla
Date Posted: 02 September 2007 at 11:33am
chong67 wrote:
What is this mod?
Where to see a demo of it?
|
this mod is for users to post quick messages to eachother on your front page or any page that gets most of your hits etc.
as for demo, refer to my previous post 
Shem
|
Posted By: thaivu
Date Posted: 06 September 2007 at 5:47am
I has mod chabox, i coded it. it has 2 file: 1 file is included in head.asp 1 file is put in the frame.
when i click sent, javascipts is auto clear the text and sent it to the frame. But the javascript is not work in firefox, only in IE.
i have to put input in the frame, i dont like it because when it reload, memb cant sent.
at that time, i have to code 2 works if FF then code 1 else code 2 end if
Can you help me to write the javascipt can clear text in the input when i click sent, it can work well in FF. thank you verry much
|
Posted By: shemzilla
Date Posted: 06 September 2007 at 7:54am
how come the input is in the frame, does it need to be there?
Shem
|
Posted By: shemzilla
Date Posted: 06 September 2007 at 7:56am
also give a link to download the files so i can see how it works
Shem
|
Posted By: shemzilla
Date Posted: 06 September 2007 at 8:03am
thaivu wrote:
I has mod chabox, i coded it. it has 2 file: 1 file is included in head.asp 1 file is put in the frame.
when i click sent, javascipts is auto clear the text and sent it to the frame. But the javascript is not work in firefox, only in IE.
i have to put input in the frame, i dont like it because when it reload, memb cant sent.
at that time, i have to code 2 works if FF then code 1 else code 2 end if
Can you help me to write the javascipt can clear text in the input when i click sent, it can work well in FF. thank you verry much
|
JS clear code: (also with focus on input)
function clearField(){
parent.document.forms[0].message.value = "";
parent.document.forms[0].message.focus();
}
|
then in your body tags:
<body onload="clearField()"> |
hope that helps Shem
|
Posted By: thaivu
Date Posted: 06 September 2007 at 11:56am
thank, i will try it and say you about result soon
|
Posted By: shemzilla
Date Posted: 06 September 2007 at 12:09pm
thaivu, are you using my shoutbox mod? it seems to be the same, only problem is that you have the input textbox in the iframe and you have a meta refresh, which sucks because when your typing, your msg gets cleared sometimes before you can submit...
which is why i have my textbox outside the frame..
Shem
|
Posted By: thaivu
Date Posted: 06 September 2007 at 12:14pm
No, i code it myself. But you understand my idea. Thank u very much. Because i want to put the content of chatbox can be load auto every 5s to show news.
------------- http://ketoan45c.net -
|
Posted By: thaivu
Date Posted: 06 September 2007 at 12:16pm
Because the javascripts cannot work in FF, so i have to solve that by put the textbox in the frame, i dont want it
------------- http://ketoan45c.net -
|
Posted By: shemzilla
Date Posted: 06 September 2007 at 12:19pm
well my shoutbox works in the same way yours does, it too can have a meta refresh like yours, and it works in all browsers and i have my input textbox outside the iframe.
what JS do you have, and what do they do? are they for your chatbox?
Shem
|
Posted By: thaivu
Date Posted: 06 September 2007 at 12:25pm
That is the code i put in main page
<FORM name=box onsubmit="return Check();" action=boxmini.asp?Menu=Add method=post target=minibox> <TABLE> <TBODY> <TR> <TD class=evenTableRow><A href="http://ketoan45c.net/forum/member_profile.asp?PF=2" target=_top><FONT color=#cc3333><B>Guest</B></FONT></A> type here: <INPUT onkeyup=storeCaret1(this); onclick=storeCaret1(this); maxLength=500 onselect=storeCaret1(this); onchange=storeCaret1(this); size=59 name=noidung> <INPUT type=hidden value=2 name=idtv> <INPUT class=button onclick=Check() type=button value=Send name=B1> </TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE>
|
i'm using javascripts
function Check() {
if(box.noidung.value == "") { alert("Hay dien noi dung cua ban!") return } document.box.submit(); document.box.reset(); }
function storeCaret1(ftext1) { if (ftext1.createTextRange) { ftext1.caretPos = document.selection.createRange().duplicate(); } }
function getText1() { if (document.box.noidung.createTextRange && document.box.noidung.caretPos) { return document.box.noidung.caretPos.text; } else { return ''; } }
|
------------- http://ketoan45c.net -
|
Posted By: shemzilla
Date Posted: 06 September 2007 at 12:30pm
how are you storing your comments in the chatbox, txtfile or db? because you can have all of that sitting outside the frame all you do is action="addcomment.asp" this page adds the comment. then the page in the iframe only display comments
does that make sense to you?
download my shoutbox, and have a look at how i structured it, it's very simple
Shem
|
Posted By: thaivu
Date Posted: 06 September 2007 at 12:34pm
oh, you are great. Thank you for your idea. by your way, i can solve my problem. anyway, i want to code js can clear text in the textbox when i clik sent button in FF
------------- http://ketoan45c.net -
|
Posted By: shemzilla
Date Posted: 06 September 2007 at 12:48pm
thaivu wrote:
anyway, i want to code js can clear text in the textbox when i clik sent button in FF
|
you don't need that.
here's the structure: addComment.asp - page that adds the comment to db or txt file... displayComment.asp - page that displays all comments, the page that sits in the iframe
then you have your form: (this sits outside the iframe) <form name="chatbox" action="addComment.asp" method="post"> <input type="textbox" name="comment" /> <input type="Submit" /> </form>
and that's it, should solve your problem goodluck Shem
|
Posted By: thaivu
Date Posted: 06 September 2007 at 6:45pm
|
thank shem very much.
i have found java to clear textbox.
if i solve my problem follow you, i still clear textbox when i click sent button.
you can visit my site to view js to clear my text box, which can work in FF very well.
|
Posted By: akiaki
Date Posted: 04 October 2007 at 7:26pm
|
Hi, I'm a total noob at this but I added your code to my default.asp, uploaded all the files but the problem is I'm using access database so I don't know how to add the table via sql commands. Can you help me please? Thank you.
|
Posted By: shemzilla
Date Posted: 05 October 2007 at 9:48am
Ok here's what ya gotta do ;) look at the sql code, it tells you what fields to create and what type to make them, if i remember correctly, instead of [varchar], use Memo type.
Hope that helps Shem
CREATE TABLE [dbo].[tblShouts]( [Shout_ID] [int] IDENTITY(1,1) NOT NULL, [Author_ID] [int] NULL, [Shout_Msg] [varchar](500) NULL, [Shout_Time] [datetime] NULL CONSTRAINT [DF_tblShouts_Shout_Time] DEFAULT (getdate()) ) ON [PRIMARY]
GO
|
Posted By: freakyfred
Date Posted: 05 October 2007 at 11:30am
|
Cheers for that shem. That seems straight forward enough.
|
Posted By: shemzilla
Date Posted: 05 October 2007 at 11:36am
Oh yes...
for the field Shout_Time, the default value must be 'Now()' or 'getdate()'
shout if you still can't figure it out ;)
|
Posted By: akiaki
Date Posted: 05 October 2007 at 8:59pm
|
thanks shemzilla!! It worked like a charm :) great mod! THANK YOU!!
|
Posted By: shemzilla
Date Posted: 08 October 2007 at 8:32am
akiaki wrote:
thanks shemzilla!! It worked like a charm :) great mod! THANK YOU!!
|
cool no problem, glad it's working
|
Posted By: Gleedo
Date Posted: 26 October 2007 at 10:52pm
|
If i am hosting my forum with WebWiz using a mySQL database, will i have the ability to run the sql scripts or will they have to do it for me????
Scratches head.....
|
Posted By: shemzilla
Date Posted: 29 October 2007 at 5:36am
Gleedo wrote:
If i am hosting my forum with WebWiz using a mySQL database, will i have the ability to run the sql scripts or will they have to do it for me????
Scratches head..... |
Hi Gleedo
you won't be able to run the sql scripts, they were made for SQL SERVER. Try ask them if they can help you create the tables in MySQL, it shouldn't be too difficult as MySQL isn't that different from SQL SERVER.
Let me know if you need help 
|
Posted By: Gleedo
Date Posted: 29 October 2007 at 10:34pm
|
Ok, thanks Shemzilla.
I'll see if i can work it out etc. Nice Job by the way :)
|
Posted By: Gleedo
Date Posted: 31 October 2007 at 2:29pm
|
Hi, will you be implementing a way to get smilies in the shoutbox?
|
Posted By: shemzilla
Date Posted: 31 October 2007 at 4:58pm
Gleedo wrote:
Hi, will you be implementing a way to get smilies in the shoutbox? |
Just a little busy at the moment, but i will have a look into it ;) Shem
|
Posted By: Gleedo
Date Posted: 31 October 2007 at 5:19pm
Thankyou Shem
Quick question if i may, i just tried running the script to create the new table that the shout box requires, but i get an error:
CREATE TABLE [dbo].[tblShouts](
[Shout_ID][int]IDENTITY( 1, 1 ) NOT NULL ,[Author_ID][int] NULL ,[Shout_Msg][varchar]( 500 ) NULL ,[Shout_Time][datetime] NULL CONSTRAINT [DF_tblShouts_Shout_Time]DEFAULT( getdate(
) ) ) ON [ PRIMARY ]GO
MySQL said: http://dev.mysql.com/doc/refman/5.0/en/error-messages-server.html"> #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[dbo].[tblShouts]( [Shout_ID] [int] IDENTITY(1,1) NOT NULL, [Author_ID] [i' at line 1
I cant see what the problem is 
|
Posted By: WebWiz-Bruce
Date Posted: 31 October 2007 at 5:32pm
This entire query would need to be re-written for mySQL as it doesn't have DBO, it also doesn't have an IDENTITY or varchar datatype, a GetDate() default value, and ON [ PRIMARY ]GO wouldn't work either.
With mySQL you need to have the ASP write the date to the database, as they are setting a getDate() default value I would imaging the ASP code will need to be re-written for this mod also to support mySQL.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: shemzilla
Date Posted: 31 October 2007 at 5:44pm
-boRg- wrote:
This entire query would need to be re-written for mySQL as it doesn't have DBO, it also doesn't have an IDENTITY or varchar datatype, a GetDate() default value, and ON [ PRIMARY ]GO wouldn't work either.
With mySQL you need to have the ASP write the date to the database, as they are setting a getDate() default value I would imaging the ASP code will need to be re-written for this mod also to support mySQL.
|
Aaah yes thats true, sorry Gleedo, my mind is elsewhere at the moment, i should of thought of all that!!
I'm Changing over to MySQL too, but i doubt you could wait for that, as i got deadlines at the moment to get thru :(
Shem
|
Posted By: Gleedo
Date Posted: 31 October 2007 at 8:12pm
|
Dont worry.
I managed to hack a frigged version of shemzillas into my mySQL version.
I also got it adding my shout text from the input box without refreshing the home page 
|
Posted By: shemzilla
Date Posted: 31 October 2007 at 9:04pm
Gleedo wrote:
Dont worry.
I managed to hack a frigged version of shemzillas into my mySQL version.
I also got it adding my shout text from the input box without refreshing the home page  |
Good to hear ;) ps: if ya don't mind, do share with us how you add the shout without refreshing?
Shem
|
Posted By: Gleedo
Date Posted: 31 October 2007 at 9:24pm
|
Hi Shem
You can see the "almost" finsihed hack of what i did here:
http://www.elitesnipercorps.com/default.asp - http://www.elitesnipercorps.com/default.asp
You will need to register though 
You had the form on the main page with an iframe below it that called shoutbox.asp.
All i did was move the table/form into shoutbox.asp and still set shoutbox.asp as the source for the iframe in default.asp.
Then when submitting the form in shoutbox.asp, i posted back to itself catching the form contents using QueryString and added it to the database.
Also in shoutbox.asp is another iframe which loads addshout.asp (now the wrong name for it). That page just gets all shout messages from the db and displays them. i put a meta refresh inside addshout.asp to it can refresh while you are typing a new message up in shoutbox.asp.
See below  . I did add one of two style changes to the dark default stylesheet because i couldnt figure out which styles i needed lol. I havent done any web development ages, so i'm a bit rusty. I would really like to add a smily selector to the shoutbox as well :)
I changed the code block in default.asp to be:
<!-- SHOUTBOX -->
<% If lngLoggedInUserID <> 2 Then%>
<table cellspacing="0" cellpadding="0" align="center" width="98%" border="0" height="200px">
<tr bgcolor="black" valign="top">
<td bgcolor="black" height="200px" valign="top"><iFrame ID="IFrame1" src="shoutBox.asp" style="width:100%;" height="100%" scrolling="no" frameborder="0"></iFrame></td>
</tr>
</table>
<%end if%><!-- SHOUTBOX END -->
|
I then modified shoutBox.asp to the following:
[code]
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%
Dim strShoutText
Dim sqlAddShout
if Request.QueryString("action") <> "" then
' we need to add to the database
strShoutText = Request.Form( "txtShout")
strShoutText = removeHTML(strShoutText,300, True)
sqlAddShout= "INSERT INTO tblShouts (Author_Name, Shout_Msg)"
sqlAddShout=sqlAddShout & " VALUES "
sqlAddShout=sqlAddShout & "('" & strLoggedInUsername & "',"
sqlAddShout=sqlAddShout & "'" & strShoutText & "')"
adoCon.Execute sqlAddShout
end if
%>
< html>
< head>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
</ head>
< body bgcolor="#373737">
< script language
|
Posted By: Gleedo
Date Posted: 31 October 2007 at 9:27pm
|
PS I could not figure out how to get a default date in my database via this web portal thingy i use, so left it out. also couldnt get the query to lookup the user id,thats why the usernames dont link to the profile page :(
|
Posted By: cbr600
Date Posted: 15 November 2007 at 1:57am
so any news on your work, guys?
is the version available from download on the first page, the final version? and does it work only on refresh, or is it auto-refreshable?
|
Posted By: exper
Date Posted: 16 November 2007 at 12:44am
|
Hata |
SQL sorgusu:
CREATE TABLE [dbo].[tblShouts](
[Shout_ID][int]IDENTITY( 1, 1 ) NOT NULL ,[Author_ID][int] NULL ,[Shout_Msg][varchar]( 500 ) NULL ,[Shout_Time][datetime] NULL CONSTRAINT [DF_tblShouts_Shout_Time]DEFAULT(
) ) ON [ PRIMARY ]GO
MySQL çıktısı: http://dev.mysql.com/doc/mysql/en/Error-returns.html"> #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[dbo].[tblShouts]( [Shout_ID] [int] IDENTITY(1,1) NOT NULL, [Author_ID] [i' at line 1 | help please :(
|
Posted By: leiti
Date Posted: 22 November 2007 at 1:54pm
|
Are there any plans to create an shoutbox which refreshes on its own?
perhaps with ajax?
|
Posted By: Gleedo
Date Posted: 22 November 2007 at 1:57pm
|
Just use http://www.shoutmix.com - www.shoutmix.com flash version, integrate very nicely.
See http://www.Elitesnipercorps.com - www.Elitesnipercorps.com at bottom of homepage :)
|
Posted By: true_king
Date Posted: 11 December 2007 at 1:25pm
|
what i use in access database?
|
Posted By: true_king
Date Posted: 11 December 2007 at 10:20pm
got this error on second post,
Microsoft JET Database Engine error '80004005'
The changes you requested to the table were
not successful because they would create duplicate values in the index,
primary key, or relationship. Change the data in the field or fields
that contain duplicate data, remove the index, or redefine the index to
permit duplicate entries and try again.
/forums/addShout.asp, line 7
btw, while using black theme the button and shout textbox text colour is grayed. how to fix it?
|
Posted By: true_king
Date Posted: 14 December 2007 at 4:10pm
for those, who need auto refresh or ajax mode for shoutbox,
i just update shoutbox.asp
<% @ Language=VBScript %> <% Option Explicit %> <!--#include file="common.asp" --> <!--#include file="functions/functions_date_time_format.asp" --> <link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
<!--LOOP SECTION FOR SHOUT BOX--> <table class="basicTable" align="left" width="100%" border="0px" cellpadding="0" cellspacing="0" > <% Dim rsShout set rsShout = server.CreateObject("ADODB.Recordset") rsShout.Open "SELECT TOP 15 Shout_Time, Username, Shout_Msg, tblShouts.Author_ID FROM tblShouts INNER JOIN tblAuthor ON tblShouts.Author_ID = tblAuthor.Author_ID ORDER BY Shout_Time DESC", adoCon
while NOT rsShout.EOF %> <tr class="tableRow"> <td valign="top"><strong>Posted <%=DateFormat(rsShout("Shout_Time"))%> at <%=TimeFormat(rsShout("Shout_Time"))%> by <a target="_parent" href="member_profile.asp?PF=<%=rsShout("Author_ID")%>"><%=rsShout("Username")%></a></strong></td> </tr> <tr class="tableRow"> <td valign="top"><%=rsShout("Shout_Msg")%></td> </tr> <tr class="tableRow"> <td valign="top"><hr></hr></td> </tr> <% rsShout.MoveNext wend rsShout.close set rsShout = nothing %> </table> <!--END OF LOOP SECTION FOR SHOUT BOX-->
<script type="text/javascript"> function reFresh() { location.reload(true); } window.setInterval("reFresh()",5000); </script> |
it woked coolz.........
anyway frnds is there any way to use emotions also? not need graphical.... it will be good like [ : ) ] (without space)
|
|