View Single Post
  #21  
Old 03-03-2009, 09:44 AM
BWJ BWJ is offline
 
Join Date: Aug 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry doesn't work for me. I have tried for 1? hour now:

Now I get this error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in [path]/modules/blog_comments_cars.php on line 31
I cannot connect to the database

I am 100% sure the password is correct - as I use it with success with e.g. your default version. This is the code I use with your changes:

PHP Code:
<?php
// I spent a while on this please leave the next couple of lines intact
// Coded by Optrex @ www.midlandsweather.org.uk
// Please do not put this onto any other site for download unless permision 

has been granted by myself (Optrex)
// This script is copyright www.midlandsweather.org.uk 

//variables to change below
$database database//replace xxx with the name of your 

database$username username//replace xxx with your database 

username$password password//replace xxx with your database 

password$wordcount 50//replace 50 with the number of words you want to 

have in your comments until cut off with ....
$website "http://xxx.com/forum/blog.php"//full website URL to your 

blog .php file including http
$prefix 
forum//table prefix - IF YOU DONT  HAVE ONE USE '' INSTEAD OF vb
$category 16//where x is the category id number found in your AdminCP
$limit 5//replace 5 with the umber of comments you want to show
//end of variables

function shorten_string($string$wordsreturned)
{
        
$retval $string;      //      Just in case of a problem
        
$array explode(" "$string);
        if (
count($array)<=$wordsreturned)
        {
                
$retval $string;
        }
        else
        {
                
array_splice($array$wordsreturned);
                
$retval implode(" "$array)."....read more";
        }
        return 
$retval;
}

$link mysql_connect ("localhost""{$username}""{$password}") or die("I 

cannot connect to the database"
);
mysql_select_db ("{$database}");
$query "SELECT {$prefix}blog.blogid, {$prefix}blog.categories, 

{$prefix}blog_text.title, {$prefix}blog_text.blogtextid, 

{$prefix}blog_text.userid, {$prefix}blog_text.username, 

{$prefix}blog_text.state, {$prefix}blog_text.pagetext, {$prefix}blog.title AS 

title2  "
.
 
"FROM {$prefix}blog, {$prefix}blog_text ".
    
"WHERE {$prefix}blog.blogid = {$prefix}blog_text.blogid AND 
{$prefix}blog_text.title = '' AND {$prefix}blog_text.state = 'visible' AND 
{$prefix}blog.categories = '{$category}'
ORDER BY 
{$prefix}blog_text.dateline desc
LIMIT 
{$limit}";
$result mysql_query($query) or die(mysql_error());
while(
$row mysql_fetch_array($result)){
$longcommentshorten_string($row['pagetext'],$wordcount);
$comment$bbcode_parser->do_parse($longcomment1,1,1,1);
    echo 
"<tr><td class=\"$bgclass\" align=\"left\"><span 

class=\"
{$Style['small']}\"><a 

href=\"
{$website}/member.php?u={$row['userid']}\">{$row['username']}</a>";
    echo 
" Made a ";
    echo 
"<a 

href=\"
{$website}/blog.php?bt={$row['blogtextid']}\">comment</a>";
    echo 
" in " 
    echo 
"<a 

href=\"
{$website}/blog.php?b={$row['blogid']}\">{$row['title2']}</a><br />";
    echo 
$comment" in " 
    echo 
"<a 

href=\"
{$website}/blog.php?b={$row['blogid']}\">{$row['title2']}</a>";
    echo 
"<br /></td></tr>";
}

?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01082 seconds
  • Memory Usage 1,824KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete