Koly007 1 Report post Posted October 11, 2007 Hallo! Also wir haben jetzt auf der Startseite von http://www.2stroke-tuning.com eingebaut dass die 10 neusten Themen angezeigt werden Die verlinken aber zB auf http://www.2stroke-tuning.com/forum/index....view=getnewpost - da wird aber CommunitySEO haben müsste der Link: http://www.2stroke-tuning.com/forum/Yamaha...html#entry55520 lauten.. Wie kann man denn das abändern? Die latest_posts.php gibt es auf invisionize - die Datei ist aber bereits abgeändert da normalerweise die Zeit auch dabei steht: Wie müsste man denn diesen Code abändern wegen den "neuen" Adressen? <? // **************************************** // // Original mod submitted by Miles Johnson. // // Completely rewritten by Anthony Petito.. // // V2.6: 15 January 2007.................. // // V2.51: 13 June 2006..................... // // V2.5: 03 June 2006..................... // // V2.1: 10 April 2005.................... // // V2.0: 04 April 2005.................... // // **************************************** // // 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, http://domain.tld/forum). // 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 filename and path. /* <?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 = "2,3,4,26"; /* TIME INTERVAL DISPLAY 0 = only days 1 = only hours 2 = only minutes 3 = only seconds *** NOT WORKING *** 4 = hours and minutes 5 = hours and seconds 6 = minutes and seconds 7 = hours, minutes, seconds Please select which interval to use (besides option 3, which is not working correctly): */ $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 "conf_global.php"; ////////////// // Database // ////////////// $mysql = mysql_connect( $INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass'] /*, $INFO['sql_driver'] */ ); if ( !$mysql ) { die( "<b>mysql_connect()</b>: ". mysql_error() ); } $select_db = mysql_select_db( $INFO['sql_database'], $mysql ); if ( !$select_db ) { die( "<b>mysql_select_db()</b>: ". mysql_error() ); } // Query the DB with the supplied user inputted variables. if ($forumexclude <> "") { $getposts = mysql_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") OR DIE (mysql_error()); } else { $getposts = mysql_query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT $posts") OR DIE (mysql_error()); } // Format and display the results. while ( $post = mysql_fetch_array($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 <p class="neue_beitrage"><a href="$INFO[board_url]/index.php?showtopic=$post[tid]&view=getnewpost">$post[short_title]</a> - Letzter Beitrag von: <a href="$INFO[board_url]/index.php?showuser=$post[last_poster_id]">$post[last_poster_name]</a></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; } ?> Denn wegen diesem Code ist die Startseite auch nicht w3c Valid.. (alle unterseiten sind valid) --> Siehe: http://validator.w3.org/check?uri=http%3A%...ine&group=0 Das wäre auch super wenn das danach valid wäre Würde mich echt freuen wenn mir jemand helfen kann lg Share this post Link to post
Koly007 1 Report post Posted October 23, 2007 (edited) Weiß denn niemand was zu meinem Problem? Find ich schade dass hier nicht mehr soviel los ist.. :( Edited October 23, 2007 by Koly007 Share this post Link to post