SitePoint Sponsor |
|
User Tag List
Results 1 to 11 of 11
Thread: Popup like sitepoint on new PM
-
Dec 23, 2001, 06:56 #1
- Join Date
- Dec 2000
- Location
- Karachi, Pakistan
- Posts
- 913
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Popup like sitepoint on new PM
Hello Guys,
Would you like me to guide how do I raise a JS Popup like we are shown when we receive a new PM with the option of opening it in a new window as well as the same ole' window.
TIA.
-Omair36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."
-
Dec 23, 2001, 07:02 #2
- Join Date
- Jun 2000
- Location
- Sydney, Australia
- Posts
- 3,798
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Omair. Are you asking how to code this feature? It really is a client side scripting issue (javascript). Would you like me to move the thread into that forum?
-
Dec 23, 2001, 08:21 #3
- Join Date
- Dec 2000
- Location
- Karachi, Pakistan
- Posts
- 913
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Sure..
-Omair36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."
-
Dec 23, 2001, 09:36 #4
- Join Date
- Dec 2000
- Location
- Karachi, Pakistan
- Posts
- 913
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Anyone???
36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."
-
Dec 23, 2001, 13:23 #5
- Join Date
- Aug 2000
- Location
- Thailand
- Posts
- 4,810
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Think it's both Sid...
You will need to have a table for messages, with a field for "read" (along with recipient user id, sender user id, message etc).
On insert, the "read" field should default to "no" (either by enmum or value).
You then need a script (prolly in some sort of included config file) that will check the user id of the user (prolly from cookie or session), then check if that table has any messages in it with that user as the recipient and the "read" option set to default.
If it does, you need to return the message id to some funky js (this bit needs to be there!), and have the "read" button direct to a display page (www.mysite.com/message?ID=xxxx).
You will also need to ensure that on loading that page (by the correct user obviously - you're gonna need verification), the record is updated to a "read" value.
Simple enough -I'm sure
H~The Artist Latterly Known as Crazy Hamster~
922ee590a26bd62eb9b33cf2877a00df
Currently delving into Django, GIT & CentOS
-
Dec 23, 2001, 15:25 #6
- Join Date
- Dec 2000
- Location
- Karachi, Pakistan
- Posts
- 913
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hello H,
Well, I know the Database stuff, the only thing I need to know is the JS Part.
-Omair36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."
-
Dec 23, 2001, 19:10 #7
- Join Date
- Jun 2001
- Location
- Toronto, Canada
- Posts
- 9,123
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
onLoad="if(confirm('You have [x: generate number dynamically] new message[s: if greater than 1 write "s"]. Would you like to read them now?')){window.location.href='pm.php';}"
-
Dec 24, 2001, 02:25 #8
- Join Date
- Dec 2000
- Location
- Karachi, Pakistan
- Posts
- 913
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hello,
Actually, Jeremy I need the code to be in PHP. I mean the code should look like:
PHP Code:echo ("<script language=\"Java Scipt\">");
Salam,
-Omair36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."
-
Dec 24, 2001, 09:31 #9
- Join Date
- Dec 2000
- Location
- Karachi, Pakistan
- Posts
- 913
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok. I have contacted freakysid personally and he told me that he was probably not the one who helped me out before. So I am sure that freddydoesphp was the one who helped me out before. So freddy are you there ?
-Omair36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."
-
Dec 24, 2001, 13:13 #10
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Sincec its Christmas Eve and I have things to still take care of, I have created the basic script for you. I wiwll leave it up to you to implement it, (change filenames, varaible names and syntax, etc....) Also you will need to run the queries and assign the pm id to the correct varaible, but this does work, if you do it properly.
PHP Code:
<?
//Query the PM table and check for new ones
//If there is a new one, assign the id of it to $newpm
$newpm = '234';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript1.2" type="text/javascript">
<!--
function pmConfirm() {
var step1 = false;
var step2 = false;
if(confirm("You have a new Private Message\nWould you like to view it?")) {
step1 = true;
}
else {
return false;
}
if(step1) {
if(confirm("Would you like to view it in a new window?\n(click cancel to view it the same window)")) {
step2 = true;
window.open("pm.php?pmid=<?=$newpm?>", "pmWindow", "toolbar=yes,scrollbars=yes,resizable=yes,width=600,height=400");
}
else {
window.location.href = "pm.php?pmid=<?=$newpm?>";
}
}
else {
return false;
}
}
<?
if($newpm) {
print "window.onLoad = pmConfirm(); ";
}
?>
//-->
</script>
</head>
<body>
</body>
</html>Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Dec 24, 2001, 13:16 #11
- Join Date
- Dec 2000
- Location
- Karachi, Pakistan
- Posts
- 913
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks a zillions.. I would check it out and would let ya know.
Salam,
-Omair36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."
Bookmarks