Jump to content

garumzīmes


dragOn
 Share

Recommended Posts

Sveiki :)

 

Lieta tāda ka uzliku fišku ka rāda sākuma lapā 5 pēdējos topikus no foruma :)

Viss strādā ka gribās tik nerāda garumzīmes :(

Es caur to notepad++ itkā uzliku lai arī strādātu garmuzīmes , bet nekā ..

 

lasttopic.php

<?php

// How Many Topics you want to display?

$topicnumber = 10;

// Change this to your phpBB path

$urlPath = "/forum";

 

// Database Configuration (Where your phpBB config.php file is located)

include 'forum/config.php';

 

$table_topics = $table_prefix. "topics";

$table_forums = $table_prefix. "forums";

$table_posts = $table_prefix. "posts";

$table_users = $table_prefix. "users";

$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");

mysql_select_db("$dbname") or die("Could not select database");

 

$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username

FROM $table_topics t, $table_forums f, $table_posts p, $table_users u

WHERE t.topic_id = p.topic_id AND

f.forum_id = t.forum_id AND

t.forum_id != 4 AND

t.topic_status <> 2 AND

p.post_id = t.topic_last_post_id AND

p.poster_id = u.user_id

ORDER BY p.post_id DESC LIMIT $topicnumber";

$result = mysql_query($query) or die("Query failed");

 

print "<table cellpadding='3' cellSpacing='2' width='640'>";

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

 

echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#FFCC00\"><b><a href=\"$urlPath/viewtopic.php?f=$row[forum_id]&t=$row[topic_id]&p=$row[post_id]#p$row[post_id]\" TARGET=\"_blank\">" .

$row["topic_title"] .

"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/memberlist.php?mode=viewprofile&u=$row[user_id]\" TARGET=\"_blank\">" .

$row["username"] .

"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\">" .

date('F j, Y, g:i a', $row["post_time"]) .

"</td></tr></font>";

}

print "</table>";

mysql_free_result($result);

mysql_close($link);

?>

 

P.S

 

Sākuma lapa ir html :)

 

Kāds varētu pateikt , kur kas jāraksta lai rādītu garumzīmes ? :D

Labots - dragOn
Link to comment
Share on other sites

1. post - es tak pieminēju jau to ka esmu izdarijis :)

nomaini faila satura formātu. - un tas būtu ? :)

 

2. ir jau :)

 

P.S

esmu galīgs iesācējs tapē ja rakstat tad rakstat tā lai man dalektu :)

Link to comment
Share on other sites

Pēc pieslēgšanās datu bāzei koda ieliec šādas rindiņas:

mysql_query("SET NAMES utf8");

mysql_query("SET CHARACTER SET utf8_latvian_ci");

Link to comment
Share on other sites

paldies , strādā :)

 

 

Tagad man ir 1 cita problēma - arī saistībā ar garumzīmēm :D

 

Izdomāju izmēģināt Jauno php-fusion 7 - atradu arī kodu kurš jāraksta ir iekšā

www\locale\jūsu_izvēlētā_valoda\global.php

 

un atrodam līnīju pašā aukšā - // Locale Settings

un pārkopējam šo visu pāri tiem

 

CODE

setlocale(LC_TIME, "lv","GB"); // Linux Server (Windows may differ)

$locale['charset'] = "UTF-8";

$locale['tinymce'] = "lv";

$locale['phpmailer'] = "lv";

 

bet kad uzmetu uz šo failu pa virsu viņš katrā lapā rāda

 

Notice: Undefined index: xml_lang in /home2/electroh/public_html/dragon/themes/templates/header.php on line 28

 

un 28 līnijā ir rakstīts

 

echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";

 

garumzīmes rāda , bet kā lai novc to Notice:

?

Link to comment
Share on other sites

 Manuprāt kļūdas paziņojums jau pats par sevi ļoti izsmeļoši izstāsta,kas viņu neapmierina. 28 rindiņā tiek izsaukts masīva elements ar nosaukumu: xml_lang ,kurš nav iepriekš nekur definēts. Pievieno viņu,un visam būtu  jābūt ok.

 

setlocale(LC_TIME, "lv","GB"); // Linux Server (Windows may differ)
$locale['charset'] = "UTF-8";
$locale['tinymce'] = "lv";
$locale['phpmailer'] = "lv"; 

$locale['xml_lang'] = "lv";

Labots - Notfound
Link to comment
Share on other sites

Izveido kontu, vai pieraksties esošajā, lai komentētu

Jums ir jābūt šī foruma biedram, lai varētu komentēt tēmas

Izveidot jaunu kontu

Piereģistrējies un izveido jaunu kontu, tas būs viegli!

Reģistrēt jaunu kontu

Pierakstīties

Jums jau ir konts? Pierakstieties tajā šeit!

Pierakstīties tagad!
 Share

×
×
  • Izveidot jaunu...