Thread: PHP SQL vBulletin 4x help

Results 1 to 4 of 4
  1. #1 PHP SQL vBulletin 4x help 
    Retired From RSPS

    iGarrett's Avatar
    Join Date
    Dec 2013
    Posts
    461
    Thanks given
    144
    Thanks received
    110
    Rep Power
    187
    This code reads the database and prints out the news onto the homepage.
    Now, I had this 100% working with IPS Forum,

    I went in and updated the code to read the vbulletin4 datavase and it's showing no recent news when I load the phone file as there is nothing in the database but I'm almost certain everything is correct also have no errors either in the error log or via php



    I'm also shite with php and SQL too so.
    Left out the SQL connecty bit just the main code is posted

    Code:
    $forum_id = 2;
    $limit = 3;
    $mysqli -> set_charset("utf8mb4");
    
    $request = $mysqli -> query ("
    	SELECT * FROM 
    		`forum` as `ft` 
    	LEFT JOIN 
    		`post` as `fp`
    	ON
    		`fp`.`threadid` = `ft`.`tid`
    	WHERE 
    		`ft`.`forumid` = $forum_id
    	ORDER BY 
    		`ft`.`tid` DESC
    	LIMIT
    		$limit
    ");
    
    if($request -> num_rows > 0)
    {
    	while($row = $request -> fetch_array(MYSQLI_BOTH))
    	{
    
    
            $post_clean = preg_replace('/[ \t]+/', ' ', preg_replace('/\s*$^\s*/m', "\n", strip_tags($row['posttext'])));
            $post_convert = strtr($post_clean, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); 
            $post = trim($post_convert, chr(0xC2).chr(0xA0));
    		$start_date = time_elapsed_string(date("D, d M Y H:i:s", $row['start_date']));
    		$topic_link = "//forum.vitalityx.org/showthread.php?".$row['tid'];
    		echo '
    <dt><span class="newsdate">'.$start_date.'</span>'.$row["title"].'</dt>
    <dd>
    <table width="100%"><tr>
    <td style="text-align: justify; vertical-align: top;">'.$post.'</td>
    <td style="padding-left: 1em; text-align: right; vertical-align: top;">
    <img width="50" height="50" src="img/news/shop_2.gif">
    </td></tr></table>
    <div style="margin-top: 0.5em;"><a href="'.$topic_link.'">Read more...</a></div>
            ';
    	}
    } else {
        echo '
                <div class="news">
                    No recent news!
                </div>
            ';
    }
    ^
    Quote Originally Posted by i am here View Post
    I have never messed with Eclipse. Is it a whole new revision or type of code?
    Quote Originally Posted by bibl View Post
    hahaha, good one m9. "deob" is short for "deobfuscated" which is not the same as decompiled.
    I'm GEEGIN' OUT
    Reply With Quote  
     

  2. #2  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    try print_r($ request) ( remove space ), see if theirs actually any results
    Reply With Quote  
     

  3. #3  
    Retired From RSPS

    iGarrett's Avatar
    Join Date
    Dec 2013
    Posts
    461
    Thanks given
    144
    Thanks received
    110
    Rep Power
    187
    Quote Originally Posted by Spooky View Post
    try print_r($ request) ( remove space ), see if theirs actually any results
    Can't get anything to print, those are the correft tables and rows hm.
    Quote Originally Posted by i am here View Post
    I have never messed with Eclipse. Is it a whole new revision or type of code?
    Quote Originally Posted by bibl View Post
    hahaha, good one m9. "deob" is short for "deobfuscated" which is not the same as decompiled.
    I'm GEEGIN' OUT
    Reply With Quote  
     

  4. #4  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by iGarrett View Post
    Can't get anything to print, those are the correft tables and rows hm.
    have you tried running the query on the db itself to make sure it even works?
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. RuneScape Highscores PHP SQL Help needed Will REPP++
    By Base in forum Website Development
    Replies: 1
    Last Post: 02-16-2014, 02:28 PM
  2. PHP - SQL injections help
    By parkview111 in forum Application Development
    Replies: 4
    Last Post: 07-18-2012, 08:13 PM
  3. Vbulletin Posting Help
    By PrataKosong in forum Application Development
    Replies: 0
    Last Post: 07-24-2009, 08:43 AM
  4. vbulletin integration help
    By joey. in forum Help
    Replies: 3
    Last Post: 01-31-2009, 06:51 AM
  5. PHP-MYSQL Error - please help me fix
    By polygon in forum Application Development
    Replies: 6
    Last Post: 11-22-2008, 01:51 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •