
otester
Members-
Posts
55 -
Joined
-
Last visited
Never
Everything posted by otester
-
I tried it with firebug and nothing shows up in the console, my chat buttons does though (which works). Been working on my site for over 12 hours straight now, got to beat this thing before 3am! Thanks trying so far thought if you can't think of anything else. EDIT: Turns out that it doesn't like php echo-ed buttons, only normally-created ones, tried the same jQuery code but added a button to a test page it works, looks like I'll have to work round this.
-
I don't have any other libraries loaded, only jQuery. I tried your code anyways: var $j = jQuery.noConflict(); $j(document).ready(function(){ $('#gen_new').click(function() { //loadPCG(); alert("The paragraph is now hidden"); }); }); Still nothing.
-
Yes the jQuery library is loaded and all other jQuery stuff (slideshow, chat) works. Also I tried sticking an alert function in: $(document).ready(function(){ $('#gen_new').click(function() { //loadPCG(); alert("The paragraph is now hidden"); }); }); It did nothing again. By the way I do have another "$(document).ready(" bit if this changes anything.
-
Currently trying to get a button on the page to call a jQuery function, I checked the W3schools callback functions section and I can't see why it won't work. The function is set to load when the page does (gets data from a MySQL database, I need the button to refresh it), which it does. When I click the button nothing happens. Page code: <button type='button' id='gen_new'>Generate a new character!</button> Js: $(document).ready(function(){ $('#gen_new').click(function() { loadPCG(); }); }); Any help would be grately appreciated! Thanks, otester
-
Worked perfectly, thanks for your help!
-
I am currently trying create a sales system where it checks the user's username against the database to check whether they are in the list of buyers. The mysql query returns "Resource id #35", I need it to return the actual username (which I manually inserted into the database to test). PHP code that fetches from database: <?php $con = mysql_connect("x","x","x"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("x", $con); $check_buyer = "SELECT * FROM Buyers WHERE Buyer='x'"; $buyer = mysql_query($check_buyer); ?> Product page: <?php include("/home/x/public_html/scripts/buyer.php"); if ($user->data['user_id'] == ANONYMOUS) { echo 'To use ' . $product . 'you must be logged in!'; echo '<br /><a href="http://x/forum/ucp.php?mode=register">Register</a>'; echo ' or '; echo '<a href="http://x/forum/ucp.php?mode=login">Sign In</a>'; } elseif ($user->data['username_clean'] == $buyer) { echo "<h3>Welcome to x</h3>"; } else { echo "You need to buy this product to use it!"; echo $user->data['username_clean']; //test whether username is outputted correctly - which it did echo $buyer; //Fetched from mysql - returned "Resource id #35", not the desired username } ?> Any help would be great! Thanks, otester
-
I was trying to make a basic slide show but I did something similar in CSS like you posted, basically making two CSS bits, one with either background and by default set to "display:none", then used jquery to do the fading in/out of either CSS bits along with a JS loops. To stop them both appearing at the same time I had to interleave them (here's code if it'll help anyone else): JavaScript/jQuery: function dynamic() { $("#site_dynamic_content").fadeIn(4000); $("#site_dynamic_content").fadeOut(4000, function() { $("#site_dynamic_content2").fadeIn(5000); $("#site_dynamic_content2").fadeOut(2000, function() { looper(); }); }); } function looper() { dynamic(); } $(document).ready(function(){ dynamic(); }); CSS: #site_dynamic_content { display:none; background-image:url(../images/17th-century-brothel-pub.png); background-repeat:no-repeat; width:654px; height:300px; cursor:pointer; } #site_dynamic_content2 { display:none; background-image:url(../images/man-on-camel.png); background-repeat:no-repeat; width:654px; height:300px; cursor:pointer; } Thanks for help!
-
Basically when the page loads it starts with the "man-on-camel" image, fades in/out then displays the "man-on-camel" image again? Why doesn't it start with the "17th-century-brothel-pub.png" image? $("#site_dynamic_content").css("background-image", "url(../images/17th-century-brothel-pub.png)"); $("#site_dynamic_content").fadeIn(2000); $("#site_dynamic_content").fadeOut(2000); $("#site_dynamic_content").css("background-image", "url(../images/man-on-camel.png)"); $("#site_dynamic_content").fadeIn(2000); Any ideas would be great! Thanks, otester
-
I see that I forgot to replace fname with Messages, thanks for your help!
-
I am currently trying to implement Ajax into a new chat function, however in the database under messages it keeps showing up as: [object HTMLInputElement] but the date (CURRENT_TIMESTAMP) works fine. Why does it do this? Here is the main code for the page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="jquery-1.4.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("form#submit").submit(function() { // we want to store the values from the form input box, then send via ajax below var fname = $('#Messages').attr('value'); $.ajax({ type: "POST", url: "ajax2.php", data: "Messages="+ Messages, success: function(){ $('form#submit').hide(function(){$('div.success').fadeIn();}); } }); return false; }); }); </script> </head> <body> <div class="container"> <form id="submit" method="post"> <fieldset> <legend>Enter Information</legend> <label for="Messages">Message:</label> <input id="Messages" class="text" name="Messages" size="20" type="text"> <button class="button positive">Submit comment!</button> </fieldset> </form> <div class="success" style="display:none;">Comment has been added.</div> </div> </body> </html> Ajax2.php file: <?php $con = mysql_connect("x","x","x"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("x", $con); // CLIENT INFORMATION $Messages = htmlspecialchars(trim($_POST['Messages'])); $addClient = "INSERT INTO Comments (Messages,Date) VALUES ('$Messages', CURRENT_TIMESTAMP)"; mysql_query($addClient) or die(mysql_error()); ?> Any help would be greatly appreciated, Thanks, otester
-
OK that just locks the page at 100% (browser height :/)
-
Fixed it: For anyone else: html { height: 100%; } body { min-height: 100%; height: 100%; }
-
My site (to see source code): http://www.punch101.com/ What I intend it to look like afterwards (roughly): http://img62.imageshack.us/img62/3227/version1u.png Problem: I want to do the shadow effect on either side of the main content bit, so the idea was to fill the [stuff in quotes = div id's] "super_container" with orange, the "main_container" is already taken care of with keeping its white background. Surrounding "main_container" would be "left_curtain" and "right_curtain", to get the curtains I took a square chunk (40x40) of both shadowy sides, created a div 40px wide on either side (hence the curtain ids), but I can't get the height to automatically equal page height even though I set the body min-height:100%; and height:100%, along with height:100% in both curtain divs and the "super_container". Any ideas? Thanks, otester
-
Seems I still had some variables above it. Hasn't come back. Thanks for your help!
-
I've tried to integrate PHPBB3 on my site, so far it works, I can use the forum login/logout and on the main page it says either "Thank you for logging in" or the buttons for "Logging in/Registering". However sometimes for no apparent reason this error is displayed at the very top of the page, logging in seems to remove it but logging out doesn't produce the error, it comes about after a few hours, everyone can see this error apparently until I/(possibly) they login: [phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /home/x/public_html/index.php:3) [phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /home/x/public_html/index.php:3) [phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /home/x/public_html/index.php:3) I ran into the error before when I was doing the integration and turned out that I wasn't putting part of the PHP code right at the top, so what could be causing this? Any help would be greatly appreciated! Thanks, otester
-
Got it to work, hope this helps anyone else that stumbles by this thread. To remove the previous errors I changed the phpbb_root_path from "/forum/" to "../forum/". Also keep the first PHP block on top of everything else. Heres the code: <?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../forum/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Testing</title> </head> <html> <body> <?php if ($user->data['user_id'] == ANONYMOUS) { echo 'Please login!'; } else { echo 'Thanks for logging in, ' . $user->data['username_clean']; } ?> </body> </html>
-
Basically I want users to use the forum login/register page and get the PHPBB3 session to be effective on external (non-forum pages) so I can control access to other parts of the site for specific user groups. My forum is located in: www.example-domain.com/forum/ Currently following the tutorial: http://www.phpbb.com/kb/article/phpbb3-sessions-integration/ Here's my site code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Testing</title> </head> <body> <?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '/forum/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); ?> <?php if ($user->data['user_id'] == ANONYMOUS) { echo 'Please login!'; } else { echo 'Thanks for logging in, ' . $user->data['username_clean']; } ?> </body> </html> I get 3 errors: Any ideas? Thanks, otester
-
Works perfectly, thank you very much for your help! (For anyone else that reads this: AlexWD's solution went between header tags and no extra JavaScript code was needed).
-
The messages are loaded by fetching them from an SQL database, no JavaScript involved in the process, so when the page loads.
-
Ok I changed the code between the header to: <script language="text/javascript"> var objDiv = document.getElementById("site_chat_box"); </script> I have a file which deals with the database and relaying the message to the div, I added this after the php tags: <script language="text/javascript"> objDiv.scrollTop = objDiv.scrollHeight; </script> Still doesn't work :/ Btw I am using overflow-x and overflow-y properties (CSS3).
-
So is there anyway to achieve what I want to do? I've been hunting around the net and it currently isn't looking very good for me
-
Currently got chat box done using SQL and PHP, however when text overflows the scroll bar won't stay at the bottom.. Currently using this code (within header): <script language="text/javascript"> var objDiv = document.getElementById("site_chat_box"); objDiv.scrollTop = objDiv.scrollHeight; </script> Unfortunately it doesn't work Any ideas? Thanks, otester
-
So simple, I should have seen it, works now. Thanks dude!
-
Is there any way to do what I want to do?
-
My site works like this for each page using the php include() feature: (include top half of site - top.php) (page content, eg: page1.php page2.php etc.) (include bottom of site - bottom.php) I want to generate meta tags, so I tried (top half of site: <meta name="keywords" content="<?php echo $keywords; ?>"> Each page has this: <?php $keywords = "dog, cat, mouse"; ?> When I check on my site it says (checking source code via browser): <meta name="keywords" content=""> Any ideas on how to get it to display the keywords? Thanks, otester