Jump to content
GIGN Forum

Jaunumu Skripts (Utf-8)


HiiD.-
 Share

Recommended Posts

9typtwmx30zhx97wu7rw.jpg

mysql_query("SET NAMES UTF-8");

Kur man jāliek tas kods lai rādītu garumzīmes?

<span style="font-family:Arial"><style>

.text-box {

border: 1px solid #ccc;

background-color: #E6E6E6;

margin: 3px;

padding: 2px;

}

.linked-image

{

border: 2px solid #CDCDCD;

padding: 1px;

-moz-border-radius: 5px;

-webkit-border-radius: 5px;

width: 147px;

height: 87px;

float: left;

margin-right: 10px;

}

</style>

<?

$cfg['forum_path'> = 'f'; //--- forum path

$cfg['forums_id'>[] = 15; //--- forum id

$cfg['latest_pos'> = 'DESC'; //--- asc/desc

$cfg['per_page'> = 1; //--- per page

$cfg['news_limit'> = 0; //--- news limit

$cfg['no_news'> = 'Nav pašlaik jaunumu'; //--- no news message

$cfg['page_select'> = true; //--- pager

$cfg['debug'> = false; //--- debug

require_once($cfg['forum_path'>."/conf_global.php" );

$mysql = mysql_connect($INFO['sql_host'>, $INFO['sql_user'>, $INFO['sql_pass'>);

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());

}

for ($i = 0; $i < count( $cfg['forums_id'> ); $i++ ) {

$cfg['forum_id'> = $cfg['forums_id'>[$i];

if ( $cfg['news_limit'> != "0" ) {

$query = mysql_query( "SELECT t.tid, t.title, t.topic_firstpost, p.pid, p.topic_id, p.post_date, p.author_id, m.id, m.name, p.post, t.posts

FROM ". $INFO['sql_tbl_prefix'> ."topics t, ". $INFO['sql_tbl_prefix'> ."posts p, ". $INFO['sql_tbl_prefix'> ."members m

WHERE t.forum_id = '". $cfg['forum_id'> ."'

AND t.tid = p.topic_id

AND p.author_id = m.id

AND p.pid = t.topic_firstpost

ORDER BY p.post_date ". $cfg['latest_pos'> ."

LIMIT ". $cfg['news_limit'> );

} else {

$query = mysql_query( "SELECT t.tid, t.title, t.topic_firstpost, p.pid, p.topic_id, p.post_date, p.author_id, m.id, m.name, p.post, t.posts

FROM ". $INFO['sql_tbl_prefix'> ."topics t, ". $INFO['sql_tbl_prefix'> ."posts p, ". $INFO['sql_tbl_prefix'> ."members m

WHERE t.forum_id = '". $cfg['forum_id'> ."'

AND t.tid = p.topic_id

AND p.author_id = m.id

AND p.pid = t.topic_firstpost

ORDER BY p.post_date ". $cfg['latest_pos'> );

}

if ( !$query ) {

die( "<b>mysql_query()</b>: ". mysql_error() );

}

$iNews = mysql_num_rows( $query );

$iRun = 0;

$iCurrent = 0;

if ( $iNews == 0 ) {

echo "<center><span style=\"font-family: Tahoma; font-size: 13px\">". $cfg['no_news'> ."</span></center><br>";

}

while ( $row = mysql_fetch_array( $query, MYSQL_NUM ) ) {

if ( $cfg['debug'> == "true" ) {

print_r( $row );

}

$iRun++;

if ( $iRun > ( $_GET['page'> - 1 ) * $cfg['per_page'> && $iCurrent < $cfg['per_page'> ) {

$sTemplate = <<<EOT

<div class="text-box"><div style="float:right;display:inline;">Pievienoja <a href="f/index.php?showuser=<!-- USER -->"/><!-- AUTHOR --></a>.</div>

<div style="font-size:110%;font-weight:bold;display:inline"><!-- TITLE --></div><hr><div class="newsitem"><img src="j_bildes/Welcome.jpg" class="linked-image" ><!-- POST --></div><div style="text-align:right"><!-- TIME --></div></div><div class="line"></div>

EOT;

/* EDIT THE DISPLAY DESIGN BELOW - CAREFUL (END) */

$sParsed = str_replace( array( "<!-- TITLE -->",

"<!-- POST -->",

"<!-- TIME -->",

"<!-- AUTHOR -->",

"<!-- REPLIES -->",

"<!-- FORUM -->",

"<!-- TOPIC -->",

"style_emoticons/<#EMO_DIR#>", //SMILEY FIX

"<!-- USER -->",

"

",

"

",

"class='quotetop'",

"class='quotemain'",

"class='codetop'",

"class='codemain'" ),

array( $row[1],

$row[9],

//Laika formats

date( "H:i, j.m.Y", $row[5] ),

$row[8],

$row[10],

$cfg['forum_path'>,

$row[0],

$cfg['forum_mape'> ."/f/style_emoticons/default",

$row[7],

"<blockquote>",

"</blockquote>",

"style='background: #E4EAF2; border: 1px dotted #000; border-bottom: 0; border-left: 4px solid #8394B2; color: #000; font-weight: bold; font-size: 10px; margin: 8px auto 0 auto; padding: 3px;'",

"style='background: #FAFCFE; border: 1px dotted #000; border-left: 4px solid #8394B2; border-top: 0; color: #465584; padding: 4px; margin: 0 auto 8px auto;'",

"style='background: #FDDBCC; color: #000; font-weight: bold; margin: 0 auto 0 auto; padding: 3px; width: 98%;'",

"style='background: #FAFCFE; border: 1px dotted #000; color: #465584; font-family: Courier, Courier New, Verdana, Arial; margin: 0 auto 0 auto; padding: 2px; width: 98%;'" ),

$sTemplate );

if ( $cfg['debug'> != "true" ) {

echo $sParsed;

}

$iCurrent++;

}

}

mysql_free_result( $query );

}

mysql_close($mysql);

if ( $cfg['page_select'> == "true" ) {

if ( $_GET['page'> == "1" || $_GET['page'> == "" ) {

echo "<span style=\"font-family: Tahoma; font-size: 13px\"><center><b><a style=\"text-decoration: none\" id=\"pages\" href=\"". $_SERVER['PHP_SELF'> ."?page=1\"><</a></b>";

} else {

echo "<span style=\"font-family: Tahoma; font-size: 13px\"><center><b><a style=\"text-decoration: none\" id=\"pages\" href=\"". $_SERVER['PHP_SELF'> ."?page=". ( $_GET['page'> - 1 ) ."\"><</a></b>";

}

for ( $i = 0; $i < $iNews / $cfg['per_page'>; $i++ ) {

if ( $i == $_GET['page'> - 1 || ( $i == 0 && $_GET['page'> == "" ) ) {

echo " <u>". ( $i + 1 ) ."</u> ";

} else {

echo " <a style=\"text-decoration: none\" id=\"pages\" href=\"". $_SERVER['PHP_SELF'> ."?page=". ( $i + 1 ) ."\">". ( $i + 1 ) ."</a> ";

}

}

if ( $_GET['page'> == $i ) {

echo "<b><a style=\"text-decoration: none\" id=\"pages\" href=\"". $_SERVER['PHP_SELF'> ."?page=". $_GET['page'> ."\">></a></b>";

} else if ( $i > 1 && $_GET['page'> == "" ) {

echo "<b><a style=\"text-decoration: none\" id=\"pages\" href=\"". $_SERVER['PHP_SELF'> ."?page=". ( $_GET['page'> + 2 ) ."\">></a></b>";

} else if ( $i <= 1 && $_GET['page'> == "" ) {

echo "<b><a style=\"text-decoration: none\" id=\"pages\" href=\"". $_SERVER['PHP_SELF'> ."?page=". ( $_GET['page'> + 1 ) ."\">></a></b>";

} else {

echo "<b><a style=\"text-decoration: none\" id=\"pages\" href=\"". $_SERVER['PHP_SELF'> ."?page=". ( $_GET['page'> + 1 ) ."\">></a></b>";

}

}

?>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...