Jump to content
php.lv forumi

<h1> nesanāk ievietot?


Snaip3Rs

Recommended Posts

labdien es mēģinu jaunumu skriptam pielikt klāt tādu līniju, kā bildē lai nebūtu pliks virsraksts, bet būtu arī bildīte apakšā un vēlētos noņemt tās līnijas kas ir zem laik kas rakstijis un komentāri! meklēju kautkur kur ir jau tāds sataisīts, bet nekā! :(

<?php
$forums = "http://lockerz.hostplex.lv/f/"; // foruma atra?anas
$limits = "5"; // limits
$forumaID = "17"; // foruma id no kura javelk ara jaunumi
$host = "localhost"; // parasti localhost
$dbname = "db"; //  db name
$dbuser = ""; // db username
$dbpass = ""; // 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("SET NAMES 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());

// 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'><img src='http://lockerz.hostplex.lv/web/bildes/laiks.png'/></span> $piev_datums | <span style='color:black'><img src='http://lockerz.hostplex.lv/web/bildes/user.png'/></span> <a href=\"$forums/index.php?showuser=".$row['starter_id']."\">".$row['starter_name']."</a> | <span style='color:black'><img src='http://lockerz.hostplex.lv/web/bildes/koment.png'/></span> (<a href=\"$forums/index.php?showtopic=".$row['tid']."&view=getlastpost\">".$row['posts']."</a>)  <hr><br>";






   echo "";

}



?>

5fpj2gbq7gd47kdubqv5.jpg

Link to comment
Share on other sites

<?php
$forums = "http://lockerz.hostplex.lv/f/"; // foruma atra?anas
$limits = "5"; // limits
$forumaID = "17"; // foruma id no kura javelk ara jaunumi
$host = "localhost"; // parasti localhost
$dbname = "db"; //  db name
$dbuser = ""; // db username
$dbpass = ""; // 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("SET NAMES 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());

// 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 "<h1 style=\"background: url(dir/url.png) repeat-x; height: 20px; color:red;\"><a href=\"$forums/index.php?showtopic=".$row['tid']."\">".$row['title']."</a> <strong>".$row['description']."</strong></h1>";
   echo "<div>".$rowis['post']."</div><br />";
   echo "<div><span style='color:black'><img src='http://lockerz.hostplex.lv/web/bildes/laiks.png'/></span> $piev_datums | <span style='color:black'><img src='http://lockerz.hostplex.lv/web/bildes/user.png'/></span> <a href=\"$forums/index.php?showuser=".$row['starter_id']."\">".$row['starter_name']."</a> | <span style='color:black'><img src='http://lockerz.hostplex.lv/web/bildes/koment.png'/></span> (<a href=\"$forums/index.php?showtopic=".$row['tid']."&view=getlastpost\">".$row['posts']."</a>)  <br>";

}



?>

 

un kas tas par "<c href=''>"? nomainīju uz "a href".

Link to comment
Share on other sites

pamaini tak šo līniju uz sev vajadzīgo un viss būs.

 

echo "<h1 style=\"background: url(dir/url.png) repeat-x; height: 20px; color:red;\"><a href=\"$forums/index.php?showtopic=".$row['tid']."\">".$row['title']."</a> <strong>".$row['description']."</strong></h1>";

Link to comment
Share on other sites

seko līdzi saviem ceļiem uz bildi.

 

echo "<h1 style=\"background: url(web/bildes/news.png) repeat-x; height: 20px; color:red;\"><a href=\"$forums/index.php?showtopic=".$row['tid']."\">".$row['title']."</a> <strong>".$row['description']."</strong></h1>";

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...