Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

Rekomendowane odpowiedzi

Opublikowano

Jestem zmuszony napisać tutaj , ponieważ na supporcie joomli nie doczekam się odpowiedzi...

Zainstalowałem Na joomli ostatnie tematy z IPB. Nie działają polskie znaki.

wygląd to tak

pre_1312202753__joomla_tabelka_news_topic.png

Kodowanie w bazie utf8_general_ci .

Kod php modułu :

[long]

<?php



// IPB Latest Topic module, version 1.6

// Author: Dmitry Chernov, www.provitiligo.com



defined('_JEXEC') or die('Direct Access to this location is not allowed.');



$document =& JFactory::getDocument();

$document->addStyleSheet(JURI::base().'modules/mod_ipb_latest/styles/common.css');	// Add stylesheet to the header of the docuemnt.



$topics = $params->get('topics');	// Get number of latest topics to display.

$symbols = $params->get('symbols');	// Get number of tipic title characters to show.

$dateformat = $params->get('dateformat');	// Get date format.

$above = $params->get('above');	// Get data to display ABOVE topics block.

$below = $params->get('below');	// Get data to display BELOW topics block.

$forum_location = $params->get('forum');	// Get forum location.

$exclude = $params->get('exclude');	// Get list of excluded forums.

$first_post_length = $params->get('first_post_length');	// Get FIRST post length.

$last_post_length = $params->get('last_post_length');	// Get LAST post length.

$allow_tags = $params->get('allow_tags');	// Get allowable tags.



$option = array();	// Open array with forum database parameters.

$option['driver'] = $params->get('driver');	// Set database driver.

$option['host'] = $params->get('host');	// Set database server.

$option['user'] = $params->get('user');	// Set database user.

$option['password'] = $params->get('password');	// Set database password.

$option['database'] = $params->get('database');	// Set database name.

$option['prefix'] = $params->get('prefix');	// Set database prefix.



$output = "";



$db = & JDatabase::getInstance($option);	// Connect to forum database with given parameters.



if (JError::isError($db))

{

jexit("Database Error: ".$db->toString());

}

if ($db->getErrorNum() > 0)

{

JError::raiseError(500, "JDatabase::getInstance: Could not connect to database <br />");

}



$topics_query = "SELECT * FROM ".$option['prefix']."topics WHERE forum_id NOT IN (".$exclude.") ORDER BY last_post DESC LIMIT 0,".$topics; // Select X latest topics from corresponding table.

$db->setQuery($topics_query);

$topics_row = $db->loadAssocList();



$time_query = "SELECT * FROM ".$option['prefix']."conf_settings WHERE conf_key='time_offset'";	// Query conf_settings table for time values.

$db->setQuery($time_query);

$server_time = $db->loadAssocList();



if (isset($server_time))

{

$time_query = "SELECT * FROM ".$option['prefix']."core_sys_conf_settings WHERE conf_key='time_offset'";	// Config query for latest version of IPB.

$db->setQuery($time_query);

$server_time = $db->loadAssocList();

}



if ($above != "")

{

$output .= "<div class='aboveText'>".$above."</div>";	// Load data above posts block.

}



for ($i=0;$i<$topics;$i++)	// Parse table rows from 0 to X.

{

$proper_time = $topics_row[$i]['last_post'] + $server_time[0]['conf_value']*60*60; // Adjust time according to IPB settings.

$post_date = gmdate($dateformat, $proper_time); // Get latest post date.

$author_name = html_entity_decode($topics_row[$i]['last_poster_name'],ENT_QUOTES); // Get last poster name.

//	$author_name = mb_convert_encoding(html_entity_decode($topics_row[$i]['last_poster_name'],ENT_QUOTES), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.

$topic_title = html_entity_decode($topics_row[$i]['title'],ENT_QUOTES); // Get recent topic title.

//	$topic_title = mb_convert_encoding(html_entity_decode($topics_row[$i]['title'],ENT_QUOTES), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.

$fname_query = "SELECT * FROM ".$option['prefix']."forums WHERE id=".$topics_row[$i]['forum_id'];

$db->setQuery($fname_query);

$fname_row = $db->loadAssocList();

$forum_name = html_entity_decode($fname_row[0]['name'],ENT_QUOTES); // Get forum name.

//	$forum_name = mb_convert_encoding(html_entity_decode($fname_row['name'],ENT_QUOTES), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.

$fpost_query = "SELECT * FROM ".$option['prefix']."posts WHERE topic_id=".$topics_row[$i]['tid']." ORDER BY post_date ASC LIMIT 0,1";

$db->setQuery($fpost_query);

$fpost_row = $db->loadAssocList();

$firstpost = html_entity_decode($fpost_row[0]['post'],ENT_QUOTES); // Get first post of the topic.

//	$firstpost = mb_convert_encoding(html_entity_decode($fpost_row[0]['post'],ENT_QUOTES), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.

$lpost_query = "SELECT * FROM ".$option['prefix']."posts WHERE topic_id=".$topics_row[$i]['tid']." ORDER BY post_date DESC LIMIT 0,1";

$db->setQuery($lpost_query);

$lpost_row = $db->loadAssocList();

$lastpost = html_entity_decode($lpost_row[0]['post'],ENT_QUOTES); // Get last post of the topic.

//	$lastpost = mb_convert_encoding(html_entity_decode($lpost_row[0]['post'],ENT_QUOTES), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.	

if (($symbols != "") && (mb_strlen($topic_title) > $symbols))

{

	$topic_title = mb_substr($topic_title, 0, $symbols, 'UTF-8')."...";	// Cut topic title to the length given in settings.

}

if (($symbols != "") && (mb_strlen($topics_row[$i]['last_poster_name']) > $symbols-4))

{

	$author_name = mb_substr($author_name, 0, $symbols-4, 'UTF-8')."..."; // Cut username to the length given in settings.

}

if (($symbols != "") && (mb_strlen($fname_row[0]['name']) > $symbols-4))

{

	$forum_name = mb_substr($forum_name, 0, $symbols-4, 'UTF-8')."...";	// Cut forum name to the length given in settings.

}	

$output .= "<div class='topicLink'><a href='".$forum_location."/index.php?showtopic=".$topics_row[$i]['tid']."&view=getlastpost' class='topicLink' title='".JText::_('GO TO LAST POST')."'>".$topic_title."</a></div>";

if ($params->get('display_name') == 0)

{

	$output .= "<div class='authorLink'>".JText::_('AUTHOR LABEL').": <a href='".$forum_location."/index.php?showuser=".$topics_row[$i]['last_poster_id']."' title='".JText::_('GO TO AUTHOR')."'>".$author_name."</a></div>"; // Add last poster name to resulting output.

}

if ($params->get('display_date') == 0)

{	

	$output .= "<div class='postDate'>".JText::_('DATE LABEL').": ".$post_date."</div>"; // Add last post date to resulting output.

}

if ($params->get('display_forum') == 0)

{

	$output .= "<div class='forumLink'>".JText::_('FORUM LABEL').": <a href='".$forum_location."/index.php?showforum=".$topics_row[$i]['forum_id']."' title='".JText::_('GO TO FORUM')."'>".$forum_name."</a></div>"; // Add last post forum name to resulting output.

}

if ($params->get('display_first_post') == 0)

{	

	$output .= "<div class='firstPost'>".strip_tags(mb_substr(preg_replace('|[[\/\!]*?[^\[\]]*?]|si', '', $firstpost),0,$first_post_length),$allow_tags)." <a href='".$forum_location."/index.php?showtopic=".$topics_row[$i]['tid']."' class='topicLink' title='".JText::_('GO TO TOPIC')."'>...</a></div>"; // Add topic's FIRST post text to resulting output.

}	

if ($params->get('display_last_post') == 0)

{

	$output .= "<div class='lastPost'>".strip_tags(mb_substr(preg_replace('|[[\/\!]*?[^\[\]]*?]|si', '', $lastpost),0,$last_post_length),$allow_tags)." <a href='".$forum_location."/index.php?showtopic=".$topics_row[$i]['tid']."&view=getlastpost' class='topicLink' title='".JText::_('GO TO LAST POST')."'>...</a></div>"; // Add topic's LAST post text to resulting output.

}	

}

if ($below != "")

{

$output .= "<div class='belowText'>".$below."</div>"; // Load data below posts block.

}



echo $output; // Display result.



?>

[/long]

ipbaddons.com

  • Manager
Opublikowano

Najpierw usuń komentarz tutaj:

//      $lastpost = mb_convert_encoding(html_entity_decode($lpost_row[0]['post'],ENT_QUOTES), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.        

Wg tego, co tam jest napisane.

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Opublikowano

i pod i nad wywala błąd

Fatal error: Call to undefined function set_names() in /portal1/modules/mod_ipb_latest/mod_ipb_latest.php on line 32

Po usunięciu tych komentarzy zmieniły się znaczki na

Co w g?�o?�nikach? 

ipbaddons.com

Opublikowano (edytowane)

No i powróciło do stanu pierwotnego.

Co w g?�o?�nikach? 

co do bazy , w postach i nazwach tematów widzę krzaki , tyle że na forum one normalnie działają

Edytowane przez Adam22

ipbaddons.com

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.