Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
Да, но с phpCentrino каза:
Защото използвам RSS-са на кал дата. А там са със <а хреф=....>фдса</а>. и дори и да приложа кода който си дал горе, той пак го записва със <a и не като линкове...jooorooo каза:heh, a za]o go zapiswate w bazata <а хреф=....>фдса</а>? записваите го като bbcode и след това го обръщайте при показване.
MontefuckeR каза:така ми трябва :wink:
<?php
$dbhost="localhost"; //hosta. в повечето случей е localhost
$dbuser=""; //Усера на базата данни
$dbpassword=""; //Паролата
$dbname=""; //Името на датабазата
$db_conn = mysql_connect("$dbhost", "$dbuser", "$dbpassword") or die("Немога да се свържа с датабазата!");
mysql_select_db("$dbname", $db_conn) or die("Немога да избера дата база!");
$xmlfile = fopen("http://www.kaldata.com/rosebud/rss.php?catid=1", "r");
if(!$xmlfile)die("cannot open the xml file");
$readfile = fread($xmlfile ,40000);
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
for($b=1 ; $b<=$count-1 ;$b++)
{
ereg("<title>(.*)</title>",$filechunks[$b], $title);
ereg("<link>(.*)</link>",$filechunks[$b], $links);
ereg("<description>(.*)</description>",$filechunks[$b],$desc);
$time = time();
$forumid = 7;
$monika = 3;
$sql = "SELECT COUNT(topic_id) as broi FROM phpbb_topics WHERE topic_title='$title[1]'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if($row['broi'] == 0)
{
$sql = mysql_query("SELECT MAX(topic_first_post_id) as last_id1,MAX(topic_last_post_id) as last_id2 FROM phpbb_topics");
$red = mysql_fetch_array($sql);
$a = $red['last_id1'];
$b = $red['last_id2'];
$aa = $a + 1;
$bb = $b + 1;
$titles = $title[1];
$dissss = $desc[1];
mysql_query("INSERT INTO `phpbb_topics` VALUES(0, $forumid, '$titles', $monika, $time, 0, 0, 0, 0, 0, $aa, $bb, 0)") or die ( mysql_error());
$sql2 = mysql_query("SELECT MAX(topic_id) as last_id FROM phpbb_topics");
$red2 = mysql_fetch_array($sql2);
$lastid = $red2['last_id'];
mysql_query("INSERT INTO `phpbb_posts` VALUES(0, $lastid, $forumid, $monika, $time, '5b5ccb4c', '', 1, 1, 1, 0, NULL, 0)") or die ( mysql_error());
$cc = mysql_insert_id();
mysql_query("INSERT INTO `phpbb_posts_text` VALUES($cc, '9a7ac8ef71', '$titles', '$dissss')") or die ( mysql_error());
$query="UPDATE phpbb_forums SET forum_posts=forum_posts+'1', forum_topics=forum_topics+'1', forum_last_post_id='$cc' where forum_id='$forumid' ";
$rez = mysql_query($query);
$query="UPDATE phpbb_users SET user_posts=user_posts+'1' where user_id='$monika' ";
mysql_query($query);
}
}
?>