Jump to content

Recommended Posts

ok, so I have this facebook like wall on a webpage and I am having trouble with the page extending when posts on the wall are past the bottom of the screen.  the posts just go off screen, no scroll bar or anything.  here is code, let me know if this isnt the right code

 

<?php
session_start();
// Must be already set
$username1 = $_SESSION['username'];
include_once "connect_to_mysql_1.php";

?><?php
if ($_POST['logout']) {


$sql = mysql_query("UPDATE sessions SET loggedin='0' where username='$username1'")or die(mysql_error());
echo  "hello '$username1'";
unset($_SESSION['username']);
}
?>
<?php
if(isset($_SESSION['username']))
{

   $query = "SELECT username, loggedin, name FROM sessions order by loggedin desc";
   $result = mysql_query($query) or die('Error : ' . mysql_error());
  
   // create the article list

   while($row = mysql_fetch_array($result, MYSQL_NUM))
   {
      list($username, $loggedin, $name) = $row;
  if ($loggedin == 1){
      $as .=  "<p><image src='ONLINE.png'></a><a href=\"javascript:void(0)\" onClick=\"javascript:chatWith('$username')\">$name</a>
</p>\r\n";
   
  }else if ($loggedin == 0){ $as .=  "<p><img src='OFFLINE.png'> </a><a href=\"javascript:void(0)\" onClick=\"javascript:chatWith('$username')\">$name</a>
</p>\r\n";
  }else{echo "you are not logged in";
  
  }}}
   
	  

  

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd" >

<head>
<title>Demos :  99Points.info : Fresh Facebook Style TextArea with Wall Posting Script using jQuery PHP and Ajax</title>
<style>
body {
background-color: #eeeeee;
padding:0;
margin:0 auto;
font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
font-size:11px;
} 
</style>

<link type="text/css" rel="stylesheet" media="all" href="css/chat.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/screen.css" />

<!--[if lte IE 7]>
<link type="text/css" rel="stylesheet" media="all" href="css/screen_ie.css" />
<![endif]-->

<style type="text/css">
#apDiv1 {
position:absolute;
left:7px;
top:312px;
width:102px;
height:124px;
z-index:300;
}
#apDiv2 {
position:absolute;
left:3px;
top:56px;
width:131px;
height:435px;
z-index:2;
}
#apDiv3 {
position:absolute;
left:267px;
top:52px;
width:345px;
height:1080px;
z-index:40;
}
#apDiv1 {
text-align: left;
}
</style>

<link href="facebox.css" media="screen" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="jquery.livequery.js"></script>
<link href="dependencies/screen.css" type="text/css" rel="stylesheet" />

<script src="jquery.elastic.js" type="text/javascript" charset="utf-8"></script>

<script src="jquery.watermarkinput.js" type="text/javascript"></script>
<script src="Spry-UI-1.7/includes/SpryDOMUtils.js" type="text/javascript"></script>
<script src="Spry-UI-1.7/includes/SpryDOMEffects.js" type="text/javascript"></script>
<script src="Spry-UI-1.7/includes/SpryWidget.js" type="text/javascript"></script>
<script src="Spry-UI-1.7/includes/SpryMenu.js" type="text/javascript"></script>
<script src="Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarKeyNavigationPlugin.js" type="text/javascript"></script>
<script src="Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarIEWorkaroundsPlugin.js" type="text/javascript"></script>
<script type="text/javascript">

// <![CDATA[	

$(document).ready(function(){	

	$('#shareButton').click(function(){

		var a = $("#watermark").val();
		if(a != "What's on your mind?")
		{
			$.post("posts.php?value="+a, {

			}, function(response){

				$('#posting').prepend($(response).fadeIn('slow'));
				$("#watermark").val("What's on your mind?");
			});
		}
	});	


	$('.commentMark').livequery("focus", function(e){

		var parent  = $('.commentMark').parent();
		$(".commentBox").children(".commentMark").css('width','320px');
		$(".commentBox").children("a#SubmitComment").hide();
		$(".commentBox").children(".CommentImg").hide();			

		var getID =  parent.attr('id').replace('record-','');			
		$("#commentBox-"+getID).children("a#SubmitComment").show();
		$('.commentMark').css('width','300px');
		$("#commentBox-"+getID).children(".CommentImg").show();			
	});	

	//showCommentBox
	$('a.showCommentBox').livequery("click", function(e){

		var getpID =  $(this).attr('id').replace('post_id','');	

		$("#commentBox-"+getpID).css('display','');
		$("#commentMark-"+getpID).focus();
		$("#commentBox-"+getpID).children("CommentImg").show();			
		$("#commentBox-"+getpID).children("a#SubmitComment").show();		
	});	

	//SubmitComment
	$('a.comment').livequery("click", function(e){

		var getpID =  $(this).parent().attr('id').replace('commentBox-','');	
		var comment_text = $("#commentMark-"+getpID).val();

		if(comment_text != "Write a comment...")
		{
			$.post("add_comment.php?comment_text="+comment_text+"&post_id="+getpID, {

			}, function(response){

				$('#CommentPosted'+getpID).append($(response).fadeIn('slow'));
				$("#commentMark-"+getpID).val("Write a comment...");					
			});
		}

	});	

	//more records show
	$('a.more_records').livequery("click", function(e){

		var next =  $('a.more_records').attr('id').replace('more_','');

		$.post("posts.php?show_more_post="+next, {

		}, function(response){
			$('#bottomMoreButton').remove();
			$('#posting').append($(response).fadeIn('slow'));

		});

	});	

	//deleteComment
	$('a.c_delete').livequery("click", function(e){

		if(confirm('Are you sure you want to delete this comment?')==false)

		return false;

		e.preventDefault();
		var parent  = $('a.c_delete').parent();
		var c_id =  $(this).attr('id').replace('CID-','');	

		$.ajax({

			type: 'get',

			url: 'delete_comment.php?c_id='+ c_id,

			data: '',

			beforeSend: function(){

			},

			success: function(){

				parent.fadeOut(200,function(){

					parent.remove();

				});

			}

		});
	});	

	/// hover show remove button
	$('.friends_area').livequery("mouseenter", function(e){
		$(this).children("a.delete").show();	
	});	
	$('.friends_area').livequery("mouseleave", function(e){
		$('a.delete').hide();	
	});	
	/// hover show remove button


	$('a.delete').livequery("click", function(e){

	if(confirm('Are you sure you want to delete this post?')==false)

	return false;

	e.preventDefault();

	var parent  = $('a.delete').parent();

	var temp    = parent.attr('id').replace('record-','');

	var main_tr = $('#'+temp).parent();

		$.ajax({

			type: 'get',

			url: 'delete.php?id='+ parent.attr('id').replace('record-',''),

			data: '',

			beforeSend: function(){

			},

			success: function(){

				parent.fadeOut(200,function(){

					main_tr.remove();

				});

			}

		});

	});

	$('textarea').elastic();

	jQuery(function($){

	   $("#watermark").Watermark("What's on your mind?");
	   $(".commentMark").Watermark("Write a comment...");

	});

	jQuery(function($){

	   $("#watermark").Watermark("watermark","#369");
	   $(".commentMark").Watermark("watermark","#EEEEEE");

	});	

	function UseData(){

	   $.Watermark.HideAll();

	   //Do Stuff

	   $.Watermark.ShowAll();

	}

});	

// ]]>

</script>

<style type="text/css">
#apDiv4 {
position:absolute;
left:0px;
top:3px;
width:auto;
height:auto;
z-index:21;
background-color: #000;
}
#apDiv5 {
position:absolute;
left:-1px;
top:0px;
width:99%;
height:54px;
z-index:22;
background-color: #000;
font-size: 14em;
}
#apDiv6 {
position:relative;
left:-1px;
top:0px;
width:99%;
height:51px;
z-index:22;
background-color: #000;
text-align: right;
}
</style>
<link href="Spry-UI-1.7/css/Menu/basic/SpryMenuBasic.css" rel="stylesheet" type="text/css">
<style type="text/css">
/* Settable values for skinning a Basic menu via presets. If presets are not sufficient, most skinning should be done in
these rules, with the exception of the images used for down or right pointing arrows, which are in the file SpryMenuBasic.css

 These assume the following widget classes for menu layout (set in a preset)
.MenuBar - Applies to all menubars - default is horizontal bar, all submenus are vertical - 2nd level subs and beyond are pull-right.
.MenuBarVertical - vertical main bar; all submenus are pull-right.

You can also pass in extra classnames to set your desired top level menu bar layout. Normally, these are set by using a preset. 
They only apply to horizontal menu bars:
	MenuBarLeftShrink - The menu bar will be horizontally 'shrinkwrapped' to be just large enough to hold its items, and left aligned
	MenuBarRightShrink - Just like MenuBarLeftShrink, but right aligned
	MenuBarFixedLeft - Fixed at a specified width set in the rule '.MenuBarFixedLeft', and left aligned.  
	MenuBarFixedCentered -  - Fixed at a specified width set in the rule '.MenuBarFixedCentered', 
					and centered in its parent container.
	MenuBarFullwidth - Grows to fill its parent container width.

In general, all rules specified in this file are prefixed by #MenuBar so they only apply to instances of the widget inserted along
with the rules. This permits use of multiple MenuBarBasic widgets on the same page with different layouts. Because of IE6 limitations,
there are a few rules where this was not possible. Those rules are so noted in comments.

*/

#MenuBar  {
background-color:#000000;	
font-family: Arial, Helvetica, sans-serif; /* Specify fonts on on MenuBar and subMenu MenuItemContainer, so MenuItemContainer,
											MenuItem, and MenuItemLabel
											at a given level all use same definition for ems.
											Note that this means the size is also inherited to child submenus, 
											so use caution in using relative sizes other than
											100% on submenu fonts. */
font-weight: normal;
font-size: 16px;
font-style: normal;
padding:0;	
border-color: #000000 #000000 #000000 #000000; 
border-width:0px;
border-style: none none none none;
}
/* Caution: because ID+class selectors do not work properly in IE6, but we want to restrict these rules to just this
widget instance, we have used string-concatenated classnames for our selectors for the layout type of the menubar 
in this section. These have very low specificity, so be careful not to accidentally override them. */

.MenuBar br { /* using just a class so it has same specificity as the ".MenuBarFixedCentered br" rule bleow */
display:none;
}
.MenuBarLeftShrink {
float: left; /* shrink to content, as well as float the MenuBar */
width: auto;
}
.MenuBarRightShrink {
float: right; /* shrink to content, as well as float the MenuBar */
width: auto;
}
.MenuBarFixedLeft {
float: left;
width: 80em;
}
.MenuBarFixedCentered {
float: none;
width: 80em;
margin-left:auto;
margin-right:auto;
}
.MenuBarFixedCentered br {
clear:both;
display:block;
}
.MenuBarFixedCentered .SubMenu br {
display:none;
}
.MenuBarFullwidth {
float: left;
width: 100%;
}

/* Top level menubar items - these actually apply to all items, and get overridden for 1st or successive level submenus */
#MenuBar  .MenuItemContainer {
padding: 0px 0px 0px 0px; 
margin: 0; 	/* Zero out margin  on the item containers. The MenuItem is the active hover area.
			For most items, we have to do top or bottom padding or borders only on the MenuItem 
			or a child so we keep the entire submenu tiled with items.
			Setting this to 0 avoids "dead spots" for hovering. */
}
#MenuBar  .MenuItem {
padding: 0px 24px 0px 0px; 
background-color:#000000;	
border-width:0px;
border-color: #cccccc #ffffff #cccccc #ffffff; 
border-style: none solid none solid;
}
#MenuBar  .MenuItemFirst {
border-style: none none none none;
}
#MenuBar .MenuItemLast {
border-style: none solid none none;
}

#MenuBar  .MenuItem  .MenuItemLabel{
text-align:center;
line-height:1.4em;
color:#ffffff;
background-color:#000000;
padding: 6px 15px 6px 39px;
width: 10em;
width:auto; 
}
.SpryIsIE6 #MenuBar  .MenuItem  .MenuItemLabel{
width:1em; /* Equivalent to min-width in modern browsers */
}

/* First level submenu items */
#MenuBar .SubMenu  .MenuItem {
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
font-size: 14px;
font-style: normal;
background-color:#ffffff;
padding:0px 2px 0px 0px;
border-width:0px;
border-color: #cccccc #cccccc #cccccc #cccccc; 
/* Border styles are overriden by first and last items */
border-style: solid solid none solid;
}
#MenuBar  .SubMenu .MenuItemFirst {
border-style: solid solid none solid;
}
#MenuBar  .SubMenu .MenuItemFirst .MenuItemLabel{
padding-top: 6px; 
}
#MenuBar .SubMenu .MenuItemLast {
border-style: solid solid solid solid;
}
#MenuBar .SubMenu .MenuItemLast .MenuItemLabel{
padding-bottom: 6px; 
}
#MenuBar .SubMenu .MenuItem .MenuItemLabel{
text-align:left;
line-height:1em;	
background-color:#ffffff;
color:#333333;
padding: 6px 12px 6px 5px; 
width: 7em;

}

/* Hover states for containers, items and labels */
#MenuBar .MenuItemHover {
background-color: #666666;
border-color: #cccccc #cccccc #cccccc #cccccc; 
}

#MenuBar .MenuItemWithSubMenu.MenuItemHover .MenuItemLabel{
background-color: #666666; /* consider exposing this prop separately*/
color: #ffffff;
}
#MenuBar .MenuItemHover .MenuItemLabel{
background-color: #666666;
color: #ffffff;
}
#MenuBar .SubMenu .MenuItemHover {
background-color: #666666; 
border-color: #666666 #cccccc #cccccc #cccccc; 
}

#MenuBar .SubMenu .MenuItemHover .MenuItemLabel{
background-color: #666666; 
color: #ffffff;
}
/* Submenu properties -- First level of submenus */
#MenuBar .SubMenuVisible {
background-color: #ffffff;
min-width:0%;  /* This keeps the menu from being skinnier than the parent MenuItemContainer - nice to have but not available on ie6 */
border-color: #ffffff #ffffff #ffffff #ffffff; 
border-width:0px;
border-style: none none none none;
}
#MenuBar.MenuBar .SubMenuVisible {/* For Horizontal menubar only */
top: 100%;	/* 100% is at the bottom of parent menuItemContainer */
left:0px; /* 'left' may need tuning depending upon borders or padding applied to menubar MenuItemContainer or MenuItem, 
				and your personal taste.
				0px will left align the dropdown with the content area of the MenuItemContainer. Assuming you keep the margins 0 
				on MenuItemContainer and MenuItem on the parent
				menubar, making this equal the sum of the MenuItemContainer & MenuItem padding-left will align 
				the dropdown with the left of the menu item label.*/
z-index:10;
}
#MenuBar.MenuBarVertical .SubMenuVisible {
top: 0px;	
left:100%;
min-width:0px; /* Do not neeed to match width to parent MenuItemContainer - items will prevent total collapse */
}
/* Submenu properties -- Second level submenu and beyond - these are visible descendents of .MenuLevel1 */
#MenuBar .MenuLevel1 .SubMenuVisible {
background-color: #ffffff;
min-width:0px; /* Do not neeed to match width to parent MenuItemContainer - items will prevent total collapse*/
top: 0px;	/* If desired, you can move this down a smidge to separate top item''s submenu from menubar - 
			that is really only needed for submenu on first item of MenuLevel1, or you can make it negative to make submenu more
			vertically 'centered' on its invoking item */
left:100%; /* If you want to shift the submenu left to partially cover its invoking item, you can add a margin-left with a 
			negative value to this rule. Alternatively, if you use fixed-width items, you can change this left value
			to use px or ems to get the offset you want. */
}
/* IE6 rules - you can delete these if you do not want to support IE6 */

/* A note about multiple classes in IE6.
* Some of the rules above use multiple class names on an element for selection, such as "hover" (MenuItemHover) and "has a subMenu" (MenuItemWithSubMenu),
* giving the selector '.MenuItemWithSubMenu.MenuItemHover'.
* Unfortunately IE6 does not support using mutiple classnames in a selector for an element. For a selector such as '.foo.bar.baz', IE6 ignores
* all but the final classname (here, '.baz'), and sets the specificity accordingly, counting just one of those classs as significant. To get around this 
* problem, we use the plugin in SpryMenuBarIEWorkaroundsPlugin.js to generate compound classnames for IE6, such as 'MenuItemWithSubMenuHover'. 
* Since there are a lot of these needed, the plugin does not generate the extra classes for modern browsers, and we use the CSS2 style mutltiple class
* syntax for that. Since IE6 both applies rules where 
* it should not, and gets the specificity wrong too, we have to order rules carefully, so the rule misapplied in IE6 can be overridden. 
* So, we put the multiple class rule first. IE6 will mistakenly apply this rule.  We follow this with the single-class rule that it would 
* mistakenly override, making sure the  misinterpreted IE6 specificity is the same as the single-class selector, so the latter wins. 
* We then create a copy of the multiple class rule, adding a '.SpryIsIE6' class as context, and making sure the specificity for
* the selector is high enough to beat the single-class rule in the "both classes match" case. We place the IE6 rule at the end of the 
* css style block to make it easy to delete if you want to drop IE6 support.
* If you decide you do not need IE6 support, you can get rid of these, as well as the inclusion of the SpryMenuBarIEWorkaroundsPlugin.js script.
* The 'SpryIsIE6' class is placed on the HTML element by  the script in SpryMenuBarIEWorkaroundsPlugin.js if the browser is Internet Explorer 6. This avoids the necessity of IE conditional comments for these rules.
*/
.SpryIsIE6 #MenuBar .MenuBarView .MenuItemWithSubMenuHover .MenuItemLabel /* IE6 selector  */{
background-color: #666666; /* consider exposing this prop separately*/
color: #ffffff;
}
.SpryIsIE6 #MenuBar .MenuBarView .SubMenu .MenuItemWithSubMenuHover .MenuItemLabel/* IE6 selector  */{
background-color: #666666; /* consider exposing this prop separately*/
color: #ffffff;
}
.SpryIsIE6 #MenuBar .SubMenu .SubMenu  /* IE6 selector  */{
margin-left: -0px; /* Compensates for at least part of an IE6 "double padding" version of the "double margin" bug */
}
#apDiv7 {
position:absolute;
top:17px;
width:411px;
height:34px;
z-index:41;
right: 6px;
}
#apDiv8 {
position:relative;
left:315px;
top:689px;
width:476px;
height:400px;
z-index:40;
}
</style>

<script type="text/xml">
<!--
<oa:widgets>
  <oa:widget wid="2141544" binding="#MenuBar" />
</oa:widgets>
-->
</script>
</head>

<body>
<div id="main_container">
welcome <?php echo $username1; ?>
<form action="samplea.php" method="post" name="logout">
<input type="submit" name="logout" id="logout" value="Logout"></form>
</div>
<div id="apDiv4"></div>
<div id="apDiv6" align="right">

</div>
<div id="apDiv7"> <ul id="MenuBar">
     <li><a href="#">Home</a>    </li>
    <li><a href="#">Profile</a></li>
    <li><a href="#">account</a>    </li>
  </ul>
  <script type="text/javascript">
// BeginOAWidget_Instance_2141544: #MenuBar
var MenuBar = new Spry.Widget.MenuBar2("#MenuBar", {
      widgetID: "MenuBar",
  widgetClass: "MenuBar  MenuBarLeftShrink",
  insertMenuBarBreak: true,
      mainMenuShowDelay: 100,
      mainMenuHideDelay: 200,
      subMenuShowDelay: 200,
      subMenuHideDelay: 200
      });
// EndOAWidget_Instance_2141544
  </script></div>
<h1> </h1>



<br clear="all" /><br clear="all" /><br clear="all" />
<br clear="all" />

<!-- FaceBook Button Start, Remove Or leave --><!-- FaceBook Button End, Remove Or leave -->

  

		  <!-- Stumbleupon Button Start, Remove Or leave --><!-- Stumbleupon Button End, Remove Or leave -->



		  <!-- Digg Button Start, Remove Or leave --><!-- Digg Button End, Remove Or leave -->

     		  



		  <!-- Delicious Button Start, Remove Or leave --><!-- Delicious Button End, Remove Or leave -->



		  <!-- Reddit Button Start, Remove Or leave --><!-- Reddit Button End, Remove Or leave -->



		  <!-- Yahoo Button Start, Remove Or leave --><!-- Yahoo Button End, Remove Or leave --><br clear="all" /><br clear="all" /><br clear="all" />
		  

<div id="apDiv1"><?php
echo $as;
?></div>
<div id="apDiv2"></div><br><br>
<div id="apDiv3"><br>
<br>
<form action="" method="post" name="postsForm">

	<div class="UIComposer_Box">

	<span class="w">
	<textarea class="input" id="watermark" name="watermark" style="height:20px" cols="60"></textarea>
	</span>

		<br clear="all" />

		<div align="left" style="height:30px; padding:10px 5px;">

			<span style="float:left">    
			 
			</span>
			<a id="shareButton" style="float:left" class="small button comment"> Share</a>
                <div align="center">



	<br clear="all" />

	<div id="posting" align="center">
      <p><br>
        <br>
        <?php
	include('dbcon.php');

	include_once('posts.php');?>
     
	</div>
</div>

		</div>

	</div>

</form>\
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/chat.js"></script>
</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/242284-page-extension/
Share on other sites

Yes, if you use the body tag as the selector it should make your entire page scroll...

 

You can also try to add html as a selector to further ensure that the entire page scrolls.

 

html, body { overflow:scroll; }

 

a div would be selected as such:

#theDiv { overflow:scroll; }

 

you should also consider the positioning of your elements, absolute/fixed may cause the issue you are having...or simply adding a div to clear at the bottom of the page...

 

css for clear:

.clear { clear: both; height: 1px; width: 100%; }

 

html

<div class="clear"> </div>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/242284-page-extension/#findComment-1244354
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.