Aller au contenu
Invision Board France

Affichage derniers post


maxmenace

Messages recommandés

Bonjour a tous,

 

encore une fois un probleme pour l'affichage des derniers post du forum sur son site web.

 

j'ai vu un post qui parlait du mod "X_Latest_Posts251" qui est en telechargement sur invisionize, mais apres inscription et differentes recherche je ne trouve pas ou le telechager, il est dispo que sur invisionize mais j'ai n'ai pas de permission.

 

 

avez vous un moyen pour que je puisse recuperer le fichier ou bien une autre methode pour m'aider, car pour l'instant tout ce que j'ai pu tester n'a pas fonctionné

 

merci bien pour votre aide

Lien vers le commentaire
Partager sur d’autres sites

Bonjour,

Display X Latest Posts v2.6 pour 2.2.x et 2.3.x

Display X Latest Posts v2.6 pour 2.1.x

 

Si t'es inscrit et validé, ça marche très bien.

 

merci bien mais je crois que je ne dois pas etre validé

 

je suis inscris depuis une semaine.

 

faut il poster un message quelque part ou bien contacter un admin

 

merci de ton aide en tout cas

Lien vers le commentaire
Partager sur d’autres sites

La validation se fait par email.

 

J'ai enfin réussi a telecharger le latest_post, cependant, maintenant j'ai un message d'erreur.

 

n'etant pas pro PHP, je vous le pose pour voir ce que vous en pensez.

 

j'ai pensais qu'il s'agissait d'un probleme de safe mode pour le PHP?

 

Merci

 

 

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /mounted-storage/home74b/sub006/sc42113-IQSL/betandco.com/paris.php on line 112

Warning: include(http://betandco.com/forum/latest_posts.php) [function.include]: failed to open stream: no suitable wrapper could be found in /mounted-storage/home74b/sub006/sc42113-IQSL/betandco.com/paris.php on line 112

Warning: include() [function.include]: Failed opening 'http://betandco.com/forum/latest_posts.php' for inclusion (include_path='.:/usr/local/lib/php/') in /mounted-storage/home74b/sub006/sc42113-IQSL/betandco.com/paris.php on line 112

Modifié par maxmenace
Lien vers le commentaire
Partager sur d’autres sites

  • Administration

Salut

 

C'est une limitation de sécurité qui a été implémentée sur ton serveur PHP.

Il ne faut pas que tu utilises une url pour faire ton include, mais une référence locale comme "./forum/latest_post.php". Ceci n'est qu'un exemple, je ne connais pas l'architecture de ton site.

Lien vers le commentaire
Partager sur d’autres sites

Salut

 

C'est une limitation de sécurité qui a été implémentée sur ton serveur PHP.

Il ne faut pas que tu utilises une url pour faire ton include, mais une référence locale comme "./forum/latest_post.php". Ceci n'est qu'un exemple, je ne connais pas l'architecture de ton site.

 

merci bien pour ton aide,

 

mais maintenant j'ai un autre probleme avec ma base de donnée

 

Fatal error: Class 'db_driver' not found in /mounted-storage/home74b/sub006/sc42113-IQSL/betandco.com/forum/latest_posts.php on line 86

 

la page fait appel a

 

require "ips_kernel/class_db_mysql.php";

require "conf_global.php";

 

 

j'ai verifier les donnée on l'aide d'etre bonne

 

qu'en penses tu

 

décolé de poser des questions qui on du etre posées 100 fois

 

merci

Lien vers le commentaire
Partager sur d’autres sites

  • Administration

Ou bien si tu n'as aucune variable/constante pour définir la racine du site, tu peux essayer de le définir :

define( 'SITE_PATH', dirname( __FILE__ ) );

require SITE_PATH . "/forum/latest_posts.php";

Et tu réutilises ton SITE_PATH pour tes autres require (de ton site, pas dans les fichiers d'IP.Board ni de la mod).

 

Par contre si le require échoue dans le fichier de la mod c'est qu'il y a peut-être une étape de configuration que du as certainement loupée.

Lien vers le commentaire
Partager sur d’autres sites

Ou bien si tu n'as aucune variable/constante pour définir la racine du site, tu peux essayer de le définir :

<?php require SITE_PATH . "/forum/latest_posts.php";?>

 

<?

// **************************************** //
// Original mod submitted by Miles Johnson. //
// Completely rewritten by Anthony Petito.. //
// V2.0: 4 April 2005...................... //
// V2.1: 10 April 2005..................... //
// V2.5: 03 JUNE 2006...................... //
// **************************************** //

// This mod will pull the latest X posts from your forum and display them on your website.  
// This new version will also handle forums that you do not wish to show (excluded forums)

// Put this file where your FORUMS are located (e.g, [url="http://domain.tld/forum)"]http://domain.tld/forum)[/url].
// This should be in the same path as your conf_global.php file
// I've commented most of the code so that it's fairly understandable, however, 
// if you're unsure of what's going on here, stick to the comments on where to edit this file for your site.

// For this to work properly, copy the following code into your website.  Change it to match the link to THIS file.
/* <?php include("http://domain.tld/forum/latest_posts.php");?> */

/////////////////////////////
// User Editable variables //
/////////////////////////////

// Change this to the number of posts you would like to show.
$posts = 10; 

// If you would like this mod to cut topics after a certain character length, leave this at 1.  Otherwise, change it to 0. 
$showtopiclength = 1; 

// Length of title to display before cutting off.  If topic title length exceeds this value, it is followed by ellipses (...)
// Only useful if the above varaible is set to 1.
$topiclength = 40; 

// Add forumid's to exclude from.  For example, you might want to exclude your private forums so that posts from it
// do not show up.  Seperate each forumid by a comma and ensure there's no spaces in between.  
$forumexclude = "38,37,71,73,69,44,75,108,74"; 


/*
TIME INTERVAL DISPLAY

0 = only days
1 = only hours
2 = only minutes
3 = only seconds
4 = hours and minutes
5 = hours and seconds
6 = minutes and seconds
7 = hours, minutes, and seconds

Please select which interval to use:
*/

$interval = 6;

/*
This will display the time interval between posts
Example: posted 3 minutes ago
Example: posted 2 hours and 3 minutes ago
Example: 1 day, 5 hours ago
*/

//OR display date only
// The following 2 lines can be changed to however you want the date and time to be displayed.  
// Default date: dd month year
// Default time: hh:mm ampm TIMEZONE (12 hour time)
// For more information on how the next 2 lines can be changed, please reference the README file.
// If you elect to show the date and time it was posted instead of the way shown above ONLY, change the $showtime variable to 1.
$showtime = 0;
$datedisplay = 'd F Y';
$timedisplay = 'h:i A T';

//////////////
// Required //
//////////////

require "ips_kernel/class_db_mysql.php";
require "conf_global.php";

define( 'SITE_PATH', dirname( __FILE__ ) );

require SITE_PATH . "/forum/latest_posts.php";

//////////////
// Database //
//////////////

$db = new db_driver;
$db->obj['sql_database']     = $INFO['sql_database'];
$db->obj['sql_user']         = $INFO['sql_user'];
$db->obj['sql_pass']         = $INFO['sql_pass'];
$db->obj['sql_host']         = $INFO['sql_host'];
$db->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];

// Connect to DB
$db->connect();

// Query the DB with the supplied user inputted variables.
$getposts = $db->query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $posts");

// Format and display the results.
while ($post = $db->fetch_row($getposts)) {

$post[full_title] = $post[title];
if ($showtopiclength == 1 AND strlen($post[full_title]) > $topiclength) {
	$post[short_title] = substr($post[full_title],0,$topiclength);
	$post[short_title] = $post[short_title]."...";
}
else {
	$post[short_title] = $post[full_title];	
}

$posted_on = date($datedisplay, $post[last_post]); // Need to change mySQL timestamp to something more human readable.
$today_date = date($datedisplay, time()); // Grab today's date so we can compare it against the posted date

if ($showtime == 0) {
	$showtimediff =  timediff($interval,time(),$post[last_post]); 
	$datefield = $showtimediff;
}
else {

	// If it was posted today, we want to display "Today, hh:mm AMPM"
	If ($posted_on == $today_date) {
		$datefield = "Today";
		$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);
	}

	// If it was posted yesterday, we want to display "Yesterday, hh:mm AMPM"
	elseif (date('d F Y',strtotime("-1 day")) == $posted_on) {
		$datefield = "Yesterday";
		$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);
	}

	else {
		$datefield = $posted_on;
	}
}

echo
/////////////////
// Post Format //
/////////////////
// Between the EOD markers you can put whatever you want in HTML format.  Just ensure that the link stays somewhat the same.
<<<EOD

<a href="$INFO[board_url]/index.php?showtopic=$post[tid]&view=getnewpost">$post[short_title]</a> by 
<a href="$INFO[board_url]/index.php?showuser=$post[last_poster_id]">$post[last_poster_name]</a> <BR>
$datefield, with $post[posts] replies.<P>

EOD;
}

function timediff($interval, $starttime, $endtime) {

$timediff = $starttime - $endtime;
$days=intval($timediff/86400);
$remain=$timediff%86400;
$hours=intval($remain/3600);
$remain=$remain%3600;
$mins=intval($remain/60);
$secs=$remain%60;

$pluraldays 	= ($days < 2) ? " day " : " days ";
$pluralhours 	= ($hours < 2) ? " hour " : " hours ";
$pluralmins 	= ($mins < 2) ? " minute " : " minutes ";
$pluralsecs 	= ($secs < 2) ? " second " : " seconds ";
$hourcount	= ($hours == 0) ? 1 : 0;
$minscount	= ($mins == 0) ? 1 : 0;
$secscount	= ($secs == 0) ? 1 : 0;

if ($days > 1) {
// If a post is older than Yesterday we want to display the the date and time it was created rather than how long ago.
// This makes it easier to display rather than having it say 3 days, 5 hours ago, for example.
	$timediff = $posted_on;
}
elseif ($days == 1) {
// The post is within 1 day old.  In this case, I've decided it may be best to show only 1 day, 5 hours ago, for example.
	$timediff = "posted ".$days." day and ".$hours.$pluralhours." ago";
}
else { 
// Less than 1 day has passed and here we use the interval that was set above.

	if ($interval == 0) { 	$timediff = "posted ".$days.$pluraldays." ago";}	// show only days
	elseif ($interval == 1) { $timediff = "posted ".$hours.$pluralhours." ago";}	// show only hours
	elseif ($interval == 2) { $timediff = "posted ".$mins.$pluralmins." ago";}	// show only minutes
	elseif ($interval == 3) { $timediff = "posted ".$secs.$pluralsecs." ago";}	// show only seconds

	elseif ($interval == 4) { // show hours and minutes
		if ($hourcount) {	$timediff = "posted ".$mins." ".$pluralmins." ago"; }
		else if ($minscount) {	$timediff = "posted ".$hours." ".$pluralhours." ago"; }
		else {	$timediff = "posted ".$hours.$pluralhours." and ".$mins." ".$pluralmins." ago"; }
	}
	elseif ($interval == 5) { // show hours and seconds
		if ($hourscount) {	$timediff = "posted ".$secs." ".$pluralsecs." ago"; }
		else if ($secscount) {	$timediff = "posted ".$hours." ".$pluralhours." ago"; }
		else {	$timediff = "posted ".$hours.$pluralhours." and ".$sec." ".$pluralsecs." ago"; }
	}
	elseif ($interval == 6) { // show minutes and seconds	
		if ($minscount == 1) {	$timediff = "posted ".$secs." ".$pluralsecs." ago"; }
		else if ($secscount == 1 ) {	$timediff = "posted ".$mins." ".$pluralmins." ago"; }
		else {	$timediff = "posted ".$mins.$pluralmins." and ".$secs." ".$pluralsecs." ago"; }
	}
	else {	// show hours, minutes and seconds 
		$timediff = "posted ".$hours.$pluralhours.", ".$mins." ".$pluralmins." and".$secs." ".$pluralsecs." ago";
	}
}

return $timediff;

}	
?>

 

voila la page latest_posts.php

 

il ya t'il un probleme quelque part?

 

merci pour votre aide precieuse

Modifié par maxmenace
Lien vers le commentaire
Partager sur d’autres sites

Non là comme ça, ça ne peut pas marcher. C'est dans le code de votre site qu'il faut le mettre, pas ailleurs.

 

oui mais le require est bien sur dans le code de mon site, je pense bie nque rien ne va fonctionner si je le met juste sur une page vierge, mais autremen voyez vous un probleme dans les codes

 

merci

Lien vers le commentaire
Partager sur d’autres sites

  • Administration

J'en vois un de problème, c'est ce que je vous dis :

define( 'SITE_PATH', dirname( __FILE__ ) );

require SITE_PATH . "/forum/latest_posts.php";

Pourquoi mettre ça dans latest_posts.php ? C'est dans le code de votre site qu'il faut le mettre, pas ailleurs...

 

Vous mettez ce bout de code dans le code de votre site. Il va appeller ./forum/latest_posts.php (faites bien attention à être sûr d'avoir uploadé latest_posts.php dans le dossier /forum, sans quoi ça ne fonctionnera pas !) et ensuite latest_posts.php fera ses require depuis le dossier forum.

Lien vers le commentaire
Partager sur d’autres sites

Rejoindre la conversation

Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

Invité
Répondre à ce sujet…

×   Collé en tant que texte enrichi.   Coller en tant que texte brut à la place

  Seulement 75 émoticônes maximum sont autorisées.

×   Votre lien a été automatiquement intégré.   Afficher plutôt comme un lien

×   Votre contenu précédent a été rétabli.   Vider l’éditeur

×   Vous ne pouvez pas directement coller des images. Envoyez-les depuis votre ordinateur ou insérez-les depuis une URL.

Chargement
×
×
  • Créer...

Information importante

En utilisant ce site, vous êtes d’accords avec nos Conditions d’utilisation. Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookies, sinon nous supposerons que vous êtes d’accord pour continuer.