die Letzte 10 beitrage ( last10.php )

nashwan

New member
11 Februar 2007
3
0
hallo leute

ich brauche euer helfe ich habe ein vbulletin forum und mochte gerne das letzte 10 beitrage auf meiner index.html site einfügen leider kriege ich nicht hin ich habe so einer site gesehen die so was hat https://www.geekvillage.com/
58491d2641.jpg



mein vbforum vision is 3.6.4

leider bekommen ich so ein meldung
/home/nawrmoh8/public_html/vbulletin/last10.php on line 48
Can't open connection to MySQL



das scripts ist hier

https://nashwan.na.ohost.de/nashwan/uploads/980aa1f6f6.rar

vielen dank für euer helfe
mfg
nash
 
Das ist die Zeile 14 in deiner last10.php
PHP:
require("$path/config.php");   
//zeile 14
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
das heist dein Pfad zu deinem Forum bzw. dessen config wird falsch sein
 
Du wirst wohl in der Datei forum/includes/config.php die richtigen MySQL Verbindungsdaten eintragen müssen..

PS:
1. Herzlich Willkommen im Forum
2. Fragen zu speziellen Programmen in Scripts&Software ** done by theHacker **
3. Scriptblöcke müssen nicht als Archiv zum Download angeboten werden, sondern können in die PHP Blöcke [ PHP ] [/ PHP ] (ohne Leerzeichen innerhalb der eckigen Klammern) eingebunden werden
 
vielen dank für euer helfe


mein vbforum arbeitet einwand frei .und auch die daten in der config.php sind richtig ,

mein daten last10config.php

Code:
<?

//...........Last X Posts ...........\\


// (c) 2001 Jelsoft Enterprises, Ltd.


//////// CONFIG EXPLANATION //////////
//

// 
$path = "includes"; // path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! Do not include "config.php"
$url = "https://localhost/vbulletin"; // URL to your board - NO TRAILING SLASH!
$urlimg = "https://localhost/vbulletin/images"; // URL to your board's images - NO TRAILING SLASH!
$maxthreads = "10"; // max threads to show. will show less if $last24 or $last7 limits it to less results than this number
$ob = "lastpost"; // set to one of the following: replycount , views , lastposter , title , lastpost (lastpost is most popular. it's the thread most recently replied to, then the second-to-last most recent, etc.)
$obdir = "desc"; // which direction to sort? "desc" goes from bottom to top (9 to 1, z to a, etc.). "asc" goes top to bottom (1 to 9, a to z, etc.). if you use lastpost for $ob, leave this set to desc or it will not work correctly!
$last24 = "0"; // 1 = last 24 hours; 0 = all (must set this to 0 if $last7 is set to 1)
$last7 = "0"; // 1 = last 7 days; 0 = all (must set this to 0 if $last24 is set to 1)
$bc1 = "#D9DEE2"; // first alt color
$bc2 = "#E4EAF2"; // second alt color
$hc = "#F1AF1D"; // head background color
$lc = "#496690"; // link color
$tc = "#496690"; // text color
$f = "Verdana"; // font face
$fs = "8"; // font size in points - 8 is normal, 6 is on the small side, 10 on the large side. play around with it. :)
$lastposter = "1"; // show last poster? 1 = yes; 0 = no
$views = "0"; // show view count? 1 = yes; 0 = no
$replies = "0"; // show reply count? 1 = yes; 0 = no
$lastpostdate = "1"; // show last post date and time? 1 = yes; 0 = no
$len = 50; // maximum number of characters of the title to show. e.g. if the title is 60 characters and this is set to 25, only the first 25 characters of the title will be shown (followed by ...)
$excludeforums = ""; // if you want to exclude a forum, put it's ID here. more than one, seperate them with commas, NO SPACES! e.g. 1,2,3,4
$includeforums = ""; // if you only want to include certain forums, put their ids here. separate more than one with commas, NO SPACES! e.g. 1,2,3,4
$showmessages = "0"; // show the text of the last post too? 1 = yes; 0 = no
$lplen = "300"; // character length of last post text (if $showmessages is set to 0 this won't do anything).
$tw = ""; // width of the table that shows the info, in either a percent ( e.g. 95% ) or in pixels ( e.g. 300 ). leave blank if you want the table to be sized naturally
$showdate = "1"; // show the date, as well as the time? if the posts that show up in the list are likely to all be from today (or you set $last24 to "1"), you can set this to 0. if the posts are spread over multiple days, you probably want this set to 1.
$cs = "0"; // this is the cellspacing. 1 makes a thin line around the cells. 0 makes no line.
$showicon = "1"; // shows the posts' icon next to the post
$showforumtitle = "0"; // shows the forum title (linked to that forum) next to the thread title
$nb = "0"; // do you want breaks in text to appear as such? this may cause problems if there are large breaks in the text
//
///////////// END CONFIG /////////////

?>


jetzt habe ich so einer meldung

Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Programme\xampp\htdocs\file\vbulletin\last10.php on line 14
Can't open connection to MySQL


ich habe auch das auch mit complete path C:/Programme/xampp/htdocs/file/vbulletin/ gegeben leider futzt hier auch wieder .

mfg
Nashwan
 
Naja meine Antwort von vorhin bleibt bestehen. Die Meldung wird in der Datei last10.php in der Zeile 14 ausgeworfen, also der Teil
PHP:
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
Der Grund steht im von mysql_connect() ausgeworfenen Fehler, nämlich dass es keine User/Passwort-Kombination in MySQL gibt, die deine übergebenen Daten beinhaltet.

Was du jetzt tun kannst:
:arrow: Überprüf mal nebenbei, ob der MySQL Server bei Xampp überhaupt angeschaltet ist (wobei ich dann glaube, dass dann eine andere Fehlermeldung käme)
:arrow: Du schreibst in last10.php folgende Zeile zwischen die aktuellen Zeilen 13 und 14 (also nach den require()'s):
PHP:
echo "Server: $servername,<br /> User: $dbusername,<br /> Passwort: $dbpassword
Dann siehst du mit welchen Daten auf die Datenbank zugegriffen werden sollen. Ich schätze einfach mal, dass dort nach den jeweiligen Doppelpunkten gar nichts steht, weil in der config.php bestimmt überall noch leere Anführungszeichen (NULL'er erwarte ich bei dem Code nicht) stehen. Falls nicht (falls also doch deine eingegebenen und plausiblen Daten stehen, schaust du nochmal genau in der Datenbank, ob der User wirklich mit dem Passwort vorhanden ist. Irgendwas in der Richtung muss es sein..
Hinterher löschst du die eingefügte Zeile natürlich wieder..
:arrow: Verwende relative Pfadangaben, sonst funktioniert es dann wieder nicht, wenn es auf dem richtigen Server (im Internet) liegt und nicht auf deinem lokalen Rechner.



BTW:
Bei solchen Beispielen erkennt man klar die Vorteile von Templates :mrgreen:
 
danke ich glaube das scripts ist nicht für das neue vb buletin geeignet

danke noch mal
mfg
nashwan