Jump to content
php.lv forumi

jaunumi.php


-rw

Recommended Posts

sveika tauta, tatad es esmu iesacejs ar php. kas īsti jaraksta tur tani forum id kur to var atrast?

 

$forumaID = "2"; // foruma id no kura jâvelk ârâ jaunumi

 

 

<?php

$forums = "foruma ceļš"; // foruma atraðanâs

$limits = "3"; // limits

$forumaID = "2"; // foruma id no kura jâvelk ârâ jaunumi

$host = "hosts"; // parasti localhost

$dbname = "DB"; // db name

$dbuser = "user"; // db username

$dbpass = "pass"; // db user pw

$link = mysql_connect($host, $dbuser, $dbpass)

or die("Neizdevas piekonekteties ?: " . mysql_error());

mysql_select_db($dbname) or die("neizdevas piekonekteties ?");

mysql_query("text/html; charset=utf8"); // charseti

 

 

// dabonam datus no DB

$kverisdivi = mysql_query("SELECT * FROM ibf_topics WHERE forum_id=".$forumaID." ORDER BY start_date DESC LIMIT ".$limits."") or die(mysql_error());

echo "<h1></h1>";

// izvadam jaunumus

while($row = mysql_fetch_array( $kverisdivi )) {

$rowis = mysql_fetch_array( mysql_query("SELECT * FROM ibf_posts WHERE topic_id = ".$row['tid']." ORDER by post_date LIMIT ".$limits.""));

$datums = $row['start_date'];

$piev_datums = date("d/m/Y ",$datums);

echo "<c href=\"$forums/index.php?showtopic=".$row['tid']."\">".$row['title']."</c> <strong>".$row['description']."</strong><br />";

echo "<div>".$rowis['post']."</div><br /><hr>";

echo "<div><span style='color:black'>Pievienots:</span> $piev_datums | <span style='color:black'>Autors:</span> <a href=\"$forums/index.php?showuser=".$row['starter_id']."\">".$row['starter_name']."</a> | <span style='color:black'>Komentari:</span> (<a href=\"$forums/index.php?showtopic=".$row['tid']."&view=getlastpost\">".$row['posts']."</a>) | <hr><br>";

 

 

 

 

 

 

echo "";

 

}

 

 

 

?>

 

kas tur pedīņas isti jaraksta.

 

$forums = "foruma ceļš"; // foruma atraðanâs

$limits = "3"; // limits

$forumaID = "2"; // foruma id no kura jâvelk ârâ jaunumi

$host = "hosts"; // parasti localhost

$dbname = "DB"; // db name

$dbuser = "user"; // db username

$dbpass = "pass"; // db user pw

Link to comment
Share on other sites

$forums = "foruma ceļš";// tava foruma atrashanas vieta,piemeram, http://localhost/forums

$limits = "3"; // cik daudzus izvilkt ara sakumlapā

$forumaID = "2"; // ieej adrese kur tev ir forums un atver tieshi to adresi ,no kuras tu gribi redzet jaunumus ,kad iejiesi tur tev bus adreses loga (kur piemeram tu raksti draugiem.lv tur bus http://adrese/forums/index.php?showforum=2 un šis 2 ir jaieraksta tur

$host = "hosts"; // raksti tur localhost

$dbuser = "user"; // raksti root

$dbpass = "pass"; // db user pw kad instalēji appserver tu ievadīji paroli un to pashu paroli raksti

$dbname = "DB"; // mape ,kuru tu izveidoji ,akd instalēji forumu ,ja neatceries tieshi tad ieej c://appserver/mysql/data un tur bus visas tavas datubazes

Edited by mp3
Link to comment
Share on other sites

$forums = "foruma ceļš";// tava foruma atrashanas vieta,piemeram, http://localhost/forums

$limits = "3"; // cik daudzus izvilkt ara sakumlapā

$forumaID = "2"; // ieej adrese kur tev ir forums un atver tieshi to adresi ,no kuras tu gribi redzet jaunumus ,kad iejiesi tur tev bus adreses loga (kur piemeram tu raksti draugiem.lv tur bus http://adrese/forums/index.php?showforum=2 un šis 2 ir jaieraksta tur

$host = "hosts"; // raksti tur localhost

$dbuser = "user"; // raksti root

$dbpass = "pass"; // db user pw kad instalēji appserver tu ievadīji paroli un to pashu paroli raksti

$dbname = "DB"; // mape ,kuru tu izveidoji ,akd instalēji forumu ,ja neatceries tieshi tad ieej c://appserver/mysql/data un tur bus visas tavas datubazes

 

man ir woano.lv hosts.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...