Jump to content

lip9000

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by lip9000

  1. Once a user has logged into my phpBB forum, the only way for them to appear as logged in is if they have ?sid=their-session-id on the end of the url to the forum at forum.mysite.net, I don't know why it just isn't declaring the $_SESSION['session_id'], it has to get it from the URL variable
  2. Yes they are, but I have found the solution, but have run into another problem. I have just found out that there is already a login function for the forum that gets activated on site login, but the only problem is that the session id needs to be in the URL in order for you to be logged into the forum. So if I go to forum.mysite.net once I am logged in, it will say that I am not logged in, but if I go to forum.mysite.net/?sid=thisisthelongsessionid, then it shows me logged in. Is there a way to change it so that users can just go to forum.mysite.net without having to enter the session id into the url?
  3. I have a site that is integrated with phpBB forum and at the moment, when a user logs into my site, they then have to go into the forum and click login, re-enter their username and password, and click login to be logged into the forum. The form to login to the phpBB forum is like this: <form action="./forum/ucp.php?mode=login" method="post"> <h3><a href="./forum/ucp.php?mode=login">Login</a> • <a href="./ucp.php?mode=register">Register</a></h3> <fieldset> <label for="username">Username:</label> <input type="text" name="lg_name" id="lg_name" size="10" title="Username" /> <label for="password">Password:</label> <input type="password" name="lg_pass" id="lg_pass" size="10" title="Password" /> <input type="submit" name="login" value="Login" /> </fieldset> </form> Is there a way to somehow submit this form with the same username and password that the users enter on my sites homepage, at the same time? So for example when the user logs in, it also logs into the forum, since the username and password is the same. I've tried to include forum/ucp.php and insert the post variables but I can't get it right.
  4. If anyone is an expert with this stuff and has good knowledge of phpBB's coding, I will give you $50 USD if you can fix this problem for me! I'm desperate, been pulling my hair out for a week now. Just can't see what's wrong.
  5. I've gone way too far to undo what I've done, I don't know why it's not logging in. Here is the function that logs the user in, I'm not sure if this is part of phpBB as it is in a script outside of the phpBB folder, I think the previous owner of the site made it: function bb3i_login($userid,$pass) { bb3i_logout(); global $auth,$db; if ($userid<1) {return false;} $sql = 'SELECT username FROM '.USERS_TABLE." WHERE user_id = '".(int)$userid."' "; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); // If authentication is successful we redirect user to previous page //die($pass); $result = $auth->login($row['username'], $pass, 1, 1, 0); // The result parameter is always an array, holding the relevant information... //die(print_r($result)); return $result['status']; return false; }
  6. bb3i_login function gets called in the login script for my site, and that function sits in functions.php in the phpbb folder, so within that function the session and cookie get's set. i've totally stuffed things up, because before i had this problem, users that had signed up before could login to my site and it would also log them into the phpbb forum, now it doesn't even work for them.
  7. I have done a search for all fields called 'user_id' and have changed them all from MEDIUMINT ( to INT (15) and now when I login i get no error and it inserts it. The only only problem now is that it's not logging me into the forum, when I go to the forum it still says to login which is weird because the bb3i_login function is being run
  8. 1. The bb3i_register function returns the id of the user that it just inserted into the forum database. 2. Parameters are correct, they all appear if i echo them out on the next page. 3. If I look at the forum database, the user does indeed get inserted with a user_id of 16777217, but the next step in the script is to insert that value into the lol_users table under forum_id. I'm still getting this error though: SQL ERROR [ mysql4 ] Out of range value adjusted for column 'user_id' at row 1 [1264] what does out of range usually mean?
  9. Ok I did a search for the user "testing12" and found an old row with that in there, so I deleted that one to solve the duplicate entry error, now when I try to login again I get the original error again: SQL ERROR [ mysql4 ] Out of range value adjusted for column 'user_id' at row 1 [1264] An sql error occurred while fetching this page. Please contact an administrator if this problem persists. UPDATE: After this error I checked the phpbb_users table and saw that it inserted that user, but it did not update lol_users and set the forumid.
  10. the function bb3i_register returns a forum id which gets assigned to $GLOBALS['forumid'], apart from that I think i am getting somewhere, there are 35600 rows in the phpbb_users table, originally user_id was set to MEDIUMINT UNSIGNED, I tried changing it to INT UNSIGNED with 15 length and now instead of that error I get this error: SQL ERROR [ mysql4 ] Duplicate entry 'testing12' for key 2 [1062] An sql error occurred while fetching this page. Please contact an administrator if this problem persists. testing12 is the user I am trying to login with whom does not have a forumid yet.
  11. I haven't modified any code as the login form points to auth.php which is where all the code for logging in, forum registration/login sits, and I haven't touched that code. What I think may have caused the problem is deleting a user manually out of the phpbb_users table, and now there is an id conflicting somewhere, here is a snippet of the login code: if ($userinfo=mysql_fetch_array($qres)) { if ($userinfo['validated']==-1) {define('ERRMSG','Banned!');} if ($userinfo['validated']>0) { mysql_free_result($qres); $_SESSION['auth']=true;$_SESSION['user']=$_POST['lg_name'];$_SESSION['uid']=$userinfo['id']; user_setonlinestate(1); $GLOBALS['forumid']=$userinfo['forumid']; if ($GLOBALS['forumid']<=0) { $GLOBALS['forumid']=bb3i_register($userinfo['name'],$_POST['lg_pass'],$userinfo['email']); if ($GLOBALS['forumid']>0) { $qres=mysql_query("UPDATE lol_users SET forumid='".(int)$GLOBALS['forumid']."' WHERE `id`=".(int)$userinfo['id']); } } if ($GLOBALS['forumid']>0) {bb3i_login($GLOBALS['forumid'],$_POST['lg_pass']);} header('Location: '.(($_GET['redir']!='')?($_GET['redir']):'home.php'));die(); } else { unset($_SESSION['uid']);unset($_SESSION['auth']);unset($_SESSION['user']); define('ERRMSG','Auth Failed!'); include 'index.php'; } } You can see that if the forum id = 0, it will register a new one and insert that ID into my sites database, otherwise it will login the user into phpbb as well.
  12. Within the login script of my website, I have implemented the phpBB function that inserts a new forum user into the forum database if it does not exist. My website is integrated with my phpBB forum. I have recently updated my login page and have deleted a few users from the forum database manually, and since then, everytime a new user logs in that has not been registered in the forum gets the following error: General Error SQL ERROR [ mysql4 ] Out of range value adjusted for column 'user_id' at row 1 [1264] An sql error occurred while fetching this page. Please contact an administrator if this problem persists. However users that have a forum id registerd previously do not get this error as the login function gets executed instead of the register function. If you are familiar with phpBB functions this is what I mean: The new user register function is: bb3i_register(username,password,email); The login function is: bb3i_login(forumid,postedpassword) Is there a way to repair this database without mucking it up? Or is there a reason why I am getting that error? Many thanks in advance!
  13. thats exactly what i was thinking, but how would i go about doing so? what functions and where about in my script would i do this? I'm not familiar with the code needed to save files and such.
  14. I have a script that generates a thumbnail in real time from a larger image, and it also compresses the larger image when that it showed as well. Images are called on the page like so: <img src="http://www.mylol.net/getphoto.php?mini&id=71925"> (id being the user ID) The problem is that because the source isn't the image directly, images aren't being cached, so when the page refreshes it has to reload every single image through the php script and resize and compress them all, and this is eating up a lot of server resources. Is there a way to edit this script so that it perhaps saves a cached version of that image into a folder on the webserver called 'cached' and looks for it next time the page loads? But also if there is a difference (say the user updates the photo) then it will reload the new image instead of the old cached version? Here is the script, MANY THANKS IN ADVANCE! <?php ob_start();session_start(); include_once 'inc/config.php'; include_once 'inc/func.general.php'; //INIT MYSQL $connection=mysql_connect(SQL_SERVER,SQL_USER,SQL_PASSWORD) or die('Cannot connect to mysql: '.mysql_error()); $result=mysql_select_db(SQL_DATABASE, $connection) or die('Cannot open mysql database: '.mysql_error()); if ((! isset($_GET['id']))&&(! isset($_GET['gid']))) {die('UNKNOWN PICTURE ID!');} if ((int)$_SESSION['uid']>0) { $query='SELECT id FROM lol_users WHERE (isadmin=1) AND (id='.(int)$_SESSION['uid'].')'; $qres=mysql_query($query) or die('MYSQL ERROR: '.mysql_error()); if (mysql_fetch_array($qres)) {define('GUEST_ISADMIN',true);} } define('GUEST_ISADMIN',false); if ($_GET['id']==-1) {define('USERBANNED',0);} elseif ($_GET['id']==-2) {define('USERBANNED',1);} if (isset($_GET['id'])&&(!defined('USERBANNED'))) { $query='SELECT fname,uid FROM lol_photos WHERE pid='.(int)$_GET['id']; $qres=mysql_query($query) or die('MYSQL ERROR: '.mysql_error()); $filename=mysql_fetch_array($qres); $ownerid=$filename['uid']; $filename=$filename['fname']; $query='SELECT validated,isex FROM lol_users WHERE id='.(int)$ownerid; $qres=mysql_query($query) or die('MYSQL ERROR: '.mysql_error()); $userinfo=mysql_fetch_array($qres); if (((int)$userinfo['validated']<1)&&(!GUEST_ISADMIN)) {define('USERBANNED',(int)$userinfo['isex']);} $ofilename='images/'.USER_PICT_DIR.'/'.$filename.'.jpg'; $mfilename='images/'.USER_PICT_DIR.'/mini/'.$filename.'.png'; } elseif (isset($_GET['gid'])) { $query='SELECT pname FROM lol_groups WHERE gid='.(int)$_GET['gid']; $qres=mysql_query($query) or die('MYSQL ERROR: '.mysql_error()); $filename=mysql_fetch_array($qres);$filename=$filename['pname']; $ofilename='images/'.GROUP_PICT_DIR.'/'.$filename.'.png'; } if (isset($_GET['mini'])&&(!defined('USERBANNED'))) { if (! file_exists($ofilename)) {die('PICTURE NOT FOUND!');} header('Content-type: image/png'); if (! file_exists($mfilename)) { list($width,$height)=getimagesize($ofilename); $new_width=100;$new_height=100; $new_width=$width;$new_height=$height; $ratio=$width/$height; if ($new_height>100) {$new_height=100;$new_width=$new_height*$ratio;} if ($new_width>100) {$new_width=100;$new_height=$new_width/$ratio;} $image2=imagecreatetruecolor($new_width,$new_height); $image =imagecreatefromjpeg($ofilename); imagecopyresampled($image2,$image,0,0,0,0,$new_width,$new_height,$width,$height); //imagepng($image2,$mfilename); imagejpeg($image2,null,65); //imagepng($image2); } else { $image=imagecreatefrompng($mfilename); imagejpeg($image,null,65); //imagepng($image); } } elseif (isset($_GET['id'])&&(!defined('USERBANNED'))) { if (! file_exists($ofilename)) {die('PICTURE NOT FOUND!');} header('Content-type: image/jpeg'); if (! sesflood_check((int)$_GET['pid'],'photov1')) { sesflood_check((int)$_GET['pid'],'photov1'); $query='UPDATE lol_photos SET views=views+1 WHERE pid='.(int)$_GET['id']; $qres=mysql_query($query) or die('MYSQL ERROR: '.mysql_error()); } $image=imagecreatefromjpeg($ofilename); imagejpeg($image,null,61); } elseif (isset($_GET['gid'])) { header('Content-type: image/png'); $image=imagecreatefrompng($ofilename); imagepng($image); } elseif (defined('USERBANNED')&&(USERBANNED==0)) { $image=imagecreatefromgif('images/'.USER_PICT_DIR.'/unknown_male.gif'); header('Content-type: image/gif'); imagegif($image);die(); } elseif (defined('USERBANNED')&&(USERBANNED==1)) { $image=imagecreatefromgif('images/'.USER_PICT_DIR.'/unknown_female.gif'); header('Content-type: image/gif'); imagegif($image);die(); } else {die('PICTURE NOT FOUND!');} ob_end_flush(); ?> The main part is about halfway down the script, the GET[mini] is for loading thumbnails.
  15. Actually, my bad, it seems to work no matter how long the length is..., even if i change it to Lipari-TV-and-this-is-extra, sure enough it echos the entire world. Hrmmm
  16. This is pretty much exactly how I had it originally, but the problem is that every users Channel name is different, so the character lengths vary for each user, it would be good if they were all the same length, that's why I need something that will get everything inbetween channel=# and &server
  17. I want to get a certain string that lies between two other strings. For example I want to extract Lipari-TV out of the following string: <embed width="563" height="266" type="application/x-shockwave-flash" flashvars="channelId=67365&brandId=1&channel=#Lipari-TV&server=chat1.ustream.tv" pluginspage="http://www.adobe.com/go/getflashplayer" src="http://www.ustream.tv/IrcClient.swf" allowfullscreen="true" /> I think it would be something to do with preg_match but I have no idea how to write it, something that would get the value between channel=# and &server
  18. I have some code that is a foreach that goes through a session variable that contains and array of POST VARS, and I need each post var to be included within the code itself, the problem is the names for each post var are contained in another variable and I don't know how to write it, currently this is what I have: if (isset($_POST['submit'])) { $_SESSION['postvars'] = $HTTP_POST_VARS; } if ($_GET['p3'] != ""){ foreach ($_SESSION['postvars'] as $key => $value) { $_POST['"$key"'] = $value; } } But it's not executing properly, it will work if I output it on the page with echo "\$_POST['$key'] = $value"; , but I don't want it displayed on the page, I want it included within the code.
  19. Explained below where? Did you miss some code?
  20. My script only gets the youtube URL, and puts it after http://keepvid.com/save-video.mp4? So my script gets http%3A%2F%2Fwww.youtube.com%2Fget_video%3Fvideo_id%3DiTBIo1c9xw0%26t%3DOEgsToPDskJd5Ezgva4cxwC76D1fDFOy%26fmt%3D18 Thats all. But I would like to create a script like the one that keepvid uses to rename the download link. I don't think rename() would work because you have to download the file first and then use that function yeh?
  21. I have a script that downloads youtube videos, but at the moment it currently downloads it as "video", with no extension. People then have to rename the file to .mp4 so that they can play it. I can't find this anywhere on google, or perhaps I am using the wrong words. I have seen this being done on keepvid, they use a script to change the extension of the download to .mp4 http://keepvid.com/save-video.mp4?http%3A%2F%2Fwww.youtube.com%2Fget_video%3Fvideo_id%3DiTBIo1c9xw0%26t%3DOEgsToPDskJd5Ezgva4cxwC76D1fDFOy%26fmt%3D18 How would I go about changing the extension like they do, but also rename the actual file as well, so from "video" to "some video name.mp4". Thanks heaps in advance!
  22. It currently is using the php mail envelope function, the function site_mail($userinfo['email'],$_POST['mm_esubj'],$emailcont); is a made up function that is included earlier in the file that contains the bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] ). I think the problem was only the sql database from gathering all the emails, but now that I have them in a text document, how can I parse through the txt file to send the message to each email that is on a new line?
  23. Hi, I have a mailing script on my website that sends an email to every user in the database, as the site has 30,000 members now everytime I do a mass mail the server freezes and I have to get hosting support to reboot it for me as the mysql and mail server gets thrashed. And it's on a dedicated dual xeon! So I've decided that to take the stress off having to query the database to get every user, I am downloading the emails column from my database into a txt file and each email will be on a new line. What would I need to modify in this script to make it go through each email in the text and send mail to it instead of grabbing it from the DB? Also if you have any tips as to how I could take some stress off the mail server that would be fantastic! Thanks a million! //FORM ACTION if (!empty($_POST['mm_esubj'])&& !empty($_POST['mm_cont']) && (isset($_POST['mm_subact'])&&($_POST['mm_subact']=='1'))) { set_time_limit(0); $query="SELECT COUNT(*) as Num FROM lol_users WHERE (validated=1)".($_POST['mm_forced']=='1'?'':' AND (orecvmail=1)'); $qres=mysql_query($query) or draw_error('MYSQL ERROR: '.mysql_error()); $ucount=mysql_fetch_array($qres);$ucount=(int)$ucount['Num']; $query="SELECT email FROM lol_users WHERE (validated=1)".($_POST['mm_forced']=='1'?'':' AND (orecvmail=1)'); $qres=mysql_query($query) or draw_error('MYSQL ERROR: '.mysql_error()); if (isset($_POST['mm_plain'])&&($_POST['mm_plain']==1)) { $conttype='text/plain'; $emailcont=$_POST['mm_subj']."\n\n".$_POST['mm_cont']; } else { $conttype='text/html'; $emailcont=file_get_contents('inc/tpl/massmail.htm'); $emailcont=str_replace('{TITLE}',$_POST['mm_subj'],$emailcont); $emailcont=str_replace('{SITEADDR}',SITEADDR,$emailcont); $emailcont=str_replace('{SUBJECT}',$_POST['mm_subj'],$emailcont); $emailcont=str_replace('{CONTENT}',nl2br($_POST['mm_cont']),$emailcont); } $i=1;echo 'Sending mail...'; while (($userinfo=mysql_fetch_array($qres))&&($i<=$ucount)) { site_mail($userinfo['email'],$_POST['mm_esubj'],$emailcont); echo ' '; if ($i%20==0) {echo $i.'..';} ob_flush();flush();$i++; } } Infact my server froze after finishing downloading the list of emails! I rebooted but.
×
×
  • 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.