Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.2.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2011, 06:25 PM
rickasawr's Avatar
rickasawr rickasawr is offline
Member
 
Join Date: Apr 2011
Location: United States
Posts: 51
Gender: Male
Credits: 8,583
rickasawr is on a distinguished road
Default Side Shoutbox Mod

I was just messing with the code and i did not like how the Shoutbox took up one full page, and i wanted it to be on the side on my sidebar.

Heres a preview of what it will look like

Oh and this is my first mod.

1. First off, you may want to take off the shoutbox page off of the main links. We will not need it there because we will put it on the side.

2. Create a new .css file, and name it shoutbox.css Here, we will put all of the styles for everything on the shoutbox. Please edit it to your liking. Copy and paste this code onto your .css file:

Code:
/* this is to specify what the background of the shoutbox iframe will have */
body{background:#ffffff;}

/* This is the "box" where the comment is in */
blockquote, .comment{
 background: #333333;
 color: #dddddd;
 padding: 10px;
 width:150px;
 margin:auto;
 margin-bottom:5px;
text-shadow: 1px 1px 1px #000000;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}

/*this is for the date of the comment*/
.userdate{
 width:100%;
 height:25px;
 color:#aaaaaa;
 font-size:10px;
 display:block;
 text-align:right;
}

/*this makes all of the comments scroll up and down while keeping the add comment form in place */
.commentwrap{
overflow:auto;
height:205px;
}

/*this contains the add comment form */
#commentform{
 width:190px;
 height:90px;
 bottom:0px;
 margin:auto;
 background:#eeeeee;
 padding-top:5px;
}

/* this is for the "submit" button and the textbox to put the comment in */
input, textarea{
 border: 1px solid #999999;
 padding: 3px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

/* this is so that the textbox does not show up as courier */
textarea{ font-family: arial; }
3. Now lets open up shoutbox.php, to make it easier for you, erase everything and paste this code:

Code:
<?php

// **********************************************************************
// Mysidia Adoptables Script: shoutbox.php by Arianna
// Copyright 2011 Mysidia Adoptables staff team
// For help and support: http://www.mysidiaadoptables.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************


// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include("inc/config.php");
include("inc/bbcode.php");

$themeurl = grabanysetting("themeurl");


// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus = logincheck();
$isloggedin = $loginstatus[loginstatus];
$loggedinname = $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************

$article_title = "Shoutbox";
$article_content = "<LINK REL=StyleSheet HREF='shoutbox.css' TYPE='text/css'><div class='commentwrap'> ";

$article_content = $article_content."<div class='enclosecomments'>";
$query = "SELECT * FROM ".$prefix."shoutbox ORDER BY id DESC LIMIT 0, 10";
$result = mysql_query($query);
$num = mysql_numrows($result);

//Loop out code
$i=0;
while ($i < $num) {
    $id=@mysql_result($result,$i,"id");
    $user=@mysql_result($result,$i,"user");
    $date=@mysql_result($result,$i,"date");
    $nolinecomment=@mysql_result($result,$i,"comment");
    $nolinecomment = bbconvert($nolinecomment);
    $comment=nl2br($nolinecomment);
    $commentdiv = "<div class='comment'><div class='userdate'>".$user." - ".$date."</div>".$comment."</div>";
    $article_content = $article_content.$commentdiv;
    $i++;
}
$article_content = $article_content."</div></div><div id='commentform'>";
$article_content = $article_content."<form action='shoutbox2.php' method='post'>
<textarea style='width:190px;height:45px;' name='comment' wrap='physical' ></textarea><br>
<input type='submit' onClick='window.location.href=window.location.href' />";

//here the user posts a comment
$comment = $_POST["comment"];
if ($comment != "") {
    $date = date("Y-m-d H:i:s");
    // $date = "10-23-3 21:02:35";
    $user = $loggedinname;
    if ($isloggedin!="yes") {
        $user = "Guest";
        }
    $comment = $comment;
    mysql_query("INSERT INTO ".$prefix."shoutbox VALUES ('', '$user', '$date', '$comment')");
    $article_content = $article_content."<br /><span style='font-size:10px;'><a href='shoutbox.php'>Comment posted. Click here.</a></span></form></div>";
}
else {
    $article_content = $article_content."</form></div>";
    }

echo $article_content;

?>
4. Now, the last thing! go to your template's template.html file. Find a place where you would like this shoutbox to be and add in this code:

Code:
<iframe src="shoutbox.php" width="190" height="300" name="shoutbox">
Your Browser does not support iframes.
</iframe>
<br />
<a target="shoutbox" onClick="window.location.reload()">Refresh The Shoutbox</a>
and your done!

Please note: editing the iframe width and height may make the shoutbox look weird and ugly. You may have to edit the length and width in your .css file. edit #commentform and .commentwrap

Last edited by rickasawr; 05-03-2011 at 06:28 PM.
Reply With Quote
  #2  
Old 05-03-2011, 07:46 PM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 38,292
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

2 Things. 1st is you probably don't need a whole new CSS just for the shoutbox. You could add it into the normal CSS pretty easily. 2nd, is that it looks pretty cool. :3
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote
  #3  
Old 05-03-2011, 08:12 PM
rickasawr's Avatar
rickasawr rickasawr is offline
Member
 
Join Date: Apr 2011
Location: United States
Posts: 51
Gender: Male
Credits: 8,583
rickasawr is on a distinguished road
Default

I just did it for the sake of an easier install.

and thankyou.
Reply With Quote
  #4  
Old 07-21-2011, 01:48 AM
xCataluna xCataluna is offline
Member
 
Join Date: Jul 2011
Posts: 6
Gender: Female
Credits: 589
xCataluna is on a distinguished road
Default

This is nifty. :3

Just a quick post, in the event that anyone had trouble getting this working, as I did...

The line:
PHP Code:
$article_content $article_content."<form action='shoutbox2.php' method='post'> 
Should be:
PHP Code:
$article_content $article_content."<form action='shoutbox.php' method='post'> 
And the section:
PHP Code:
// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus logincheck();
$isloggedin $loginstatus[loginstatus];
$loggedinname $loginstatus[username]; 
Seems to create an issue where everyone is named "Guest", so I simply removed it.
Reply With Quote
  #5  
Old 09-12-2011, 03:06 AM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 57,028
RoconzaArt is an unknown quantity at this point
Default

I have follow both instructions and yet can't get the username to display.
__________________
Reply With Quote
  #6  
Old 09-12-2011, 11:39 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 483,159
Hall of Famer is on a distinguished road
Default

Well I dunno if I should bring it up, but the OP's last activity was...

Quote:
Last Activity: 06-03-2011 12:15 PM
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 09-12-2011, 05:40 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 57,028
RoconzaArt is an unknown quantity at this point
Default

Darn oh well then.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Side Bar v1.3.3 Nieth Questions and Supports 10 06-04-2013 06:11 PM
Show Favorite Pet in Side Bar Abronsyth Questions and Supports 6 02-26-2013 09:08 AM
How to edit Side Bar? Abronsyth Questions and Supports 6 12-11-2012 04:09 PM
1.3.0 where is the CSS for the side menu? Kesstryl Templates and Themes 5 03-18-2012 08:42 PM
Display images side by side? SilverDragonTears Questions and Supports 5 06-06-2011 02:55 AM


All times are GMT -5. The time now is 09:36 PM.

Currently Active Users: 805 (0 members and 805 guests)
Threads: 4,081, Posts: 32,029, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636