Jump to content
php.lv forumi

Problēma ar news scriptu!


sandijs

Recommended Posts

Sveiki!

Tad nu tā es izmantoju jaunumu scriptu kas izvelk ārā no foruma pēdējos jaunumus, viss ir ok un darbojas kā vaig, bet kad forumā ielieku kā du smaidiņu, main lapā attēlojas kā nosaukums.gif teiksim tā, un tas ir viss, ne pats smaidiņš, ne cēļš uz viņu vairs nau, lai gan pašā forumā viss ok!

 

Varbūt varat jū profiņi uzmest aci un pateikt, kas tieši scriptam pietrūkst? (Sistēma uz ko izmantoju ir IPB 2.3.x)

 

Scripts:

 

<?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 "";

}



?>

 

Paldies jau iepriekš!

Edited by sandijs
Link to comment
Share on other sites

Skriptam nekas nepietrūkst, forumā url uz smaidiņiem ir cita, publicējot citā lapā, protams, ka url vairs nebūs īstā un nekas nerādīsies. Veidojot iekš IPB jaunu topiku pastāv tāda iespēja, kā diseiblot smaidiņus (tobiš, lai nerādītos kā bilde).

Link to comment
Share on other sites

Mjā to zinu, bet vēlos lai tomēr smaidiņi atēlojas, tas padara dinamiskāku lpp.

Nau kāda iespēja piekodēt klāt kādu scriptu vai ko tādu...?

 

ā kamēr atceros, man ir tas login forma, bet viņā neatēlojas profila bilde, jo augšupielādē ir atslēgta, un var bildi uzlikt tikai caur citiem url:

<?php
mysql_connect("HOSTS", "LIETOTAJS", "PAROLE");
mysql_select_db("DB");

if(isset($_COOKIE['member_id'])){
$get=mysql_query("SELECT * FROM `ibf_members` WHERE id='".intval($_COOKIE['member_id'])."'") or die(mysql_error());
$id = $_COOKIE['member_id'];
$dati= "SELECT * FROM `ibf_members` WHERE id = $id LIMIT 1";
$dati1=mysql_query($dati) or mysql_error();
$dati2= mysql_fetch_array($dati1);
 $avatar= "SELECT * FROM `ibf_member_extra` WHERE id = $id LIMIT 1";
$avatar1=mysql_query($avatar) or mysql_error();
$avatar2= mysql_fetch_array($avatar1);
$udata=mysql_fetch_object($get);
if($udata->member_login_key==$_COOKIE['pass_hash']) {

$logout = md5($dati2['email']."&".$dati2['member_login_key']."&".$dati2['joined']);
$bilde = ($avatar2['avatar_location']);
echo"<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>";
$status = $row['mgroup'];
$admins = '4';
if ($status == $admins)
{
echo "<a href=	'?do=piev_video'>Pievienot Video,";
}
echo "

<center>Sveiks, ".$udata->members_display_name."</center><br><center><img src='http://mans webs/forum/uploads/$bilde'><br><br></br></center>";


/*---------------------------------------------------------*/
echo"
<img src='images/ikonas/labot.png'><a href= 'forum/index.php?act=UserCP&CODE=00'> Labot profilu</a><br>
<img src='images/ikonas/pz.png'><a href= 'forum/index.php?act=Msg&CODE=01'> Saņemtās vēstules</a><br>
<img src='images/ikonas/group.png'><a href= 'forum/index.php?act=Members'> Lietotāji</a><br>
<img src='images/ikonas/meklet.png'><a href= 'forum/index.php?act=Search&f=0'> Meklēt forumā</a><br>
<img src='images/ikonas/noteikumi.png'><a href= 'forum/index.php?showtopic=133'> Noteikumi</a><br>

<img src='images/ikonas/off.png'><a href= 'forum/index.php?act=Login&CODE=03&k=".$logout."'> Iziet</a><br></br>";


}else{
echo "<form method='post' action='forum/index.php?act=Login&CODE=01' name='LOGIN'>
<b>Lietotājvārds:</b><br>
<input style='width: 124px;' name='UserName' type='text' class='inputs'><br>
<b>Parole:</b><br>
<input style='width: 124px;' name='PassWord' type='password' class='inputs'><br>
<b>Atceries mani?</b>
<input name='CookieDate' value='1' type='checkbox'><br>
<input value='Ienākt' name='CookieDate' type='submit'  class='poga' >

</form>";

}

}else{

echo "

<form method='post' action='forum/index.php?act=Login&CODE=01' name='LOGIN'>

<b>Lietotājvārds:</b><br>
<input style='width: 124px;' name='UserName' type='text' class='inputs'><br>
<b>Parole:</b><br>
<input style='width: 124px;' name='PassWord' type='password' class='inputs'><br>
<input value='Ienākt' name='CookieDate' type='submit'  class='poga' ><input name='CookieDate' value='1' type='checkbox'>
</form>";



}

?>
<style type="text/css">
a:link { color: #52504c; text-decoration: none;}
a:visited { color: #52504c; text-decoration: none; }
a:hover { text-decoration: underline; color: #52504c;}
a:active { color: #52504c; text-decoration: none; 
outline: none;}
</style>

 

ja nemaldos kaut kas jamaina te:

 

src='http://mans webs/forum/uploads/$bilde'> bet kas un kur?

Edited by sandijs
Link to comment
Share on other sites

echo "<center>Sveiks, ".$udata->members_display_name."</center><br><center><img src='http://mans webs/forum/uploads/$bilde'><br><br></br></center>";

Būtu jābūt:

 

echo "<center>Sveiks, ".$udata->members_display_name."</center><br><center><img src='http://mans webs/forum/uploads/".$bilde."'><br><br></br></center>";

Link to comment
Share on other sites

echo "<center>Sveiks, ".$udata->members_display_name."</center><br><center><img src='http://mans webs/forum/uploads/$bilde'><br><br></br></center>";

Būtu jābūt:

 

echo "<center>Sveiks, ".$udata->members_display_name."</center><br><center><img src='http://mans webs/forum/uploads/".$bilde."'><br><br></br></center>";

 

Nav starpības kurš variants, abi strādās.

 

echo "teksts $var teksts";
echo "teksts " . $var . " teksts";
echo 'teksts ' . $var . ' teksts';

Šie varianti strādās vienlīdz labi

Edited by briedis
Link to comment
Share on other sites

echo "<center>Sveiks, ".$udata->members_display_name."</center><br><center><img src='http://mans webs/forum/uploads/$bilde'><br><br></br></center>";

Būtu jābūt:

 

echo "<center>Sveiks, ".$udata->members_display_name."</center><br><center><img src='http://mans webs/forum/uploads/".$bilde."'><br><br></br></center>";

 

Pārbaudīju šo variantu - profila bilde neuzrādās :(

 

Bet to 2 variantu īsti es nesapprotu kas tajos text vieta jaraksta?

 

Uzgaidiet man problēmas ar upload atēlošanu foruma profilā!

Edited by sandijs
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...