Hi,
Anyone of you here is using Web Chat Manager 2.0? (http://www.webscriptworld.com/scripts/wcm.phtml) Or anyone here is interested to help me out? Please give me a source code or teach me what should I do to add in "Smiley" for the chat box. Thanks and greatly appreciate your help!!
Smileys for Web Chat Manager 2.0
Moderator: General Moderators
Hi friend,
Thanks for your help. Anyway, I'm really too new to PHP. I used to be with HTML until I found PHP is quite powerful if associate with HTML. Anyway, can you please teach me where to include this code? Below is the script... And, thanks for your kind help!!
send.php
-----------
<?
if (file_exists("vars.php")):
include("vars.php");
endif;
?>
<HTML>
<HEAD>
<TITLE><? echo "$title"; ?></TITLE>
</HEAD>
<?
echo "<body bgcolor=\"$bgcolor\" text=\"$text\" link=\"$link\" vlink=\"$vlink\" alink=\"$alink\">";
echo "<font face=\"$font\" size=\"$size\">";
?>
<form method="post" action="main.php" target="main" onsubmit="this.chat.value=this.chatvis.value;this.chatvis.value='';this.chatvis.focus();">
<input type="hidden" name="username" value="<? echo "$username"; ?>">
<input type="hidden" name="uid" value="<? echo "$uid"; ?>">
<input type="hidden" name="msg" value="post">
<input type="hidden" name="chat" value="">
<input name="chatvis" type="text" size="50" maxlength="300">
<select name="fcolor">
<?
$cartFile = File("colors.txt");
$length = sizeof($cartFile);
$i = 0;
while ($i < $length):
$tok = strtok($cartFile[$i],"|");
$code = $tok;
$tok = strtok("|");
$color = $tok;
echo "<option value=\"$code\">$color";
$i++;
endwhile;
?>
<select>
<input type="submit" value="Send">
</form>
</BODY>
</HTML>
Thanks for your help. Anyway, I'm really too new to PHP. I used to be with HTML until I found PHP is quite powerful if associate with HTML. Anyway, can you please teach me where to include this code? Below is the script... And, thanks for your kind help!!
send.php
-----------
<?
if (file_exists("vars.php")):
include("vars.php");
endif;
?>
<HTML>
<HEAD>
<TITLE><? echo "$title"; ?></TITLE>
</HEAD>
<?
echo "<body bgcolor=\"$bgcolor\" text=\"$text\" link=\"$link\" vlink=\"$vlink\" alink=\"$alink\">";
echo "<font face=\"$font\" size=\"$size\">";
?>
<form method="post" action="main.php" target="main" onsubmit="this.chat.value=this.chatvis.value;this.chatvis.value='';this.chatvis.focus();">
<input type="hidden" name="username" value="<? echo "$username"; ?>">
<input type="hidden" name="uid" value="<? echo "$uid"; ?>">
<input type="hidden" name="msg" value="post">
<input type="hidden" name="chat" value="">
<input name="chatvis" type="text" size="50" maxlength="300">
<select name="fcolor">
<?
$cartFile = File("colors.txt");
$length = sizeof($cartFile);
$i = 0;
while ($i < $length):
$tok = strtok($cartFile[$i],"|");
$code = $tok;
$tok = strtok("|");
$color = $tok;
echo "<option value=\"$code\">$color";
$i++;
endwhile;
?>
<select>
<input type="submit" value="Send">
</form>
</BODY>
</HTML>
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Dear friends,
Thanks for your help and finally I solved the smileys problem by adding in $chat = str_replace(":))", "<img src='/chatroom/img/surprised.gif'>", $chat);
Anyway, I guess I need your help again. I want to create ranking for my members, which the ranking is controlled by me and I'll edit my member's file directly from my computer to select how many stars should he/she has. My question is, how can I make the stars display beside the Ranking column? I'll create few files like 1star.gif, 2stars.gif, 3stars.gif. Thanks and appreciate your help! Below is the code
profile.php
----------------
<?
if (file_exists("vars.php")):
include("vars.php");
endif;
?>
<html>
<head>
<title><? echo "$title"; ?></title>
</head>
<?
echo "<body bgcolor=\"$bgcolor\" text=\"$text\" link=\"$link\" vlink=\"$vlink\" alink=\"$alink\">";
echo "<font face=\"$font\" size=\"$size\">";
?>
<?
if (file_exists("users/$username.php")):
include("users/$username.php");
endif;
?>
<center>
<P>
<table width="450" border="1" cellspacing="0" cellpadding="5" bordercolor="<? echo "$bordercolor"; ?>" bordercolorlight="<? echo "$bordercolor"; ?>" bordercolordark="<? echo "$bordercolor"; ?>">
<!--DWLayoutTable-->
<tr>
<td width="115"><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Screen
Name:</td>
<td width="309"><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$username"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Ranking
:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$ranking"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Name:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$name"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Age:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$age"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Sex:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$sex"; ?>
</td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Email:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><a href="mailto:<? echo "$email1"; ?>"><? echo "$email1"; ?></a> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>City:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$city"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Country:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$country"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Web
Site URL:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "<a href=\"$url\" target=\"new\">$url</a>"; ?> </td>
</tr>
<tr>
<td valign="top"><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>About
Me:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$descrip"; ?>
</td>
</tr>
</table>
</center>
</body>
</html>
guest.php (member file)
--------------------------
<?
$username = "guest";
$ranking = "Founder";
$user = "";
$passwd = "abcdefghijklmnop";
$pass = "";
$name = "Anonymous";
$age = "111";
$sex = "Male";
$email = "someone@abc.com";
$email1 = "someone@abc.com";
$city = "LA";
$country = "Mars";
$url = "http://nationalzoo.tk";
$descrip = "";
?>[/b]
Thanks for your help and finally I solved the smileys problem by adding in $chat = str_replace(":))", "<img src='/chatroom/img/surprised.gif'>", $chat);
Anyway, I guess I need your help again. I want to create ranking for my members, which the ranking is controlled by me and I'll edit my member's file directly from my computer to select how many stars should he/she has. My question is, how can I make the stars display beside the Ranking column? I'll create few files like 1star.gif, 2stars.gif, 3stars.gif. Thanks and appreciate your help! Below is the code
profile.php
----------------
<?
if (file_exists("vars.php")):
include("vars.php");
endif;
?>
<html>
<head>
<title><? echo "$title"; ?></title>
</head>
<?
echo "<body bgcolor=\"$bgcolor\" text=\"$text\" link=\"$link\" vlink=\"$vlink\" alink=\"$alink\">";
echo "<font face=\"$font\" size=\"$size\">";
?>
<?
if (file_exists("users/$username.php")):
include("users/$username.php");
endif;
?>
<center>
<P>
<table width="450" border="1" cellspacing="0" cellpadding="5" bordercolor="<? echo "$bordercolor"; ?>" bordercolorlight="<? echo "$bordercolor"; ?>" bordercolordark="<? echo "$bordercolor"; ?>">
<!--DWLayoutTable-->
<tr>
<td width="115"><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Screen
Name:</td>
<td width="309"><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$username"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Ranking
:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$ranking"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Name:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$name"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Age:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$age"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Sex:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$sex"; ?>
</td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Email:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><a href="mailto:<? echo "$email1"; ?>"><? echo "$email1"; ?></a> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>City:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$city"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Country:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$country"; ?> </td>
</tr>
<tr>
<td><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>Web
Site URL:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "<a href=\"$url\" target=\"new\">$url</a>"; ?> </td>
</tr>
<tr>
<td valign="top"><? echo "<font face=\"$font\" size=\"$size\" color=\"$color\">"; ?>About
Me:</td>
<td><? echo "<font face=\"$font\" size=\"$size\">"; ?><? echo "$descrip"; ?>
</td>
</tr>
</table>
</center>
</body>
</html>
guest.php (member file)
--------------------------
<?
$username = "guest";
$ranking = "Founder";
$user = "";
$passwd = "abcdefghijklmnop";
$pass = "";
$name = "Anonymous";
$age = "111";
$sex = "Male";
$email = "someone@abc.com";
$email1 = "someone@abc.com";
$city = "LA";
$country = "Mars";
$url = "http://nationalzoo.tk";
$descrip = "";
?>[/b]
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Here's a snippet that may help:
Code: Select all
<?php
function write_rating($rating)
{
$result = "";
for( $i = 0; $i < $rating; $i++)
$result .= "<img src="images/star.gif">";
echo $result;
}
?>Just create a variable in the member's file and refer to that.
Do something like $member_stars as variable.. enter a 1, 2, or 3 as it's value and create a check where you want it to be displayed.. check like...
see?
Do something like $member_stars as variable.. enter a 1, 2, or 3 as it's value and create a check where you want it to be displayed.. check like...
Code: Select all
<?php
echo "<img src=";
if ($member_stars == "1"){
echo "star1.gif";
}
elseif ($member_stars == "2"){
echo "star2.gif";
}