hey there...
I wanted to have rss news in my forums, one per topic so they can be commented and discussed. I think this is cool cause it allows you to keep a newsarchive on your forums.

ok... originaly i wrote the code to use myself with some settings mixed up inside the code, bad programing practive i know. Also the variable names, wich are very descriptive were writen in portuguese.

i went through the script and adapted it, the original version is working like a charm on my forums. I didnt test the modified version though so its possible that it has some kind of bug, i think not wink

If you need it just try it out, if you get some errors report them and i fix the problem.

You have to create a new table on your database and define some setings. The feed urls should be inserted in that table. The sql to create the table is in the code as a comment


OK, so this is how i put this working:
i created a folder in punbbroot and put this file there, you can name it whatever you feel like. I also put magpie and a modified copy of search_idx.php.
You can dload magpie here.
since this only works with mysql and i didnt had access to the database class, my modified search_idx.php has all the $db->function() replaced by the equivalent nativve mysql function. Like, $db->query() is replaced by mysql_query().

Ok... i know this is bad programing practice, i just wanted to have it working.
Anyway... any questions or trouble reply to this message.

<?php

//configuration=================================================================
//database===========================================
$db_host = '';
$db_name = '';
$db_username = '';
$db_password = '';

//other===============================================
$newstbot_name=''; //name of the user that make the news post
$newsbot_id='';  //id of that user
$newsforum_id=''; //the id of the forum where you wan the news to go
$follow_link_text='Read more at'; //change this if you want to display some other text
//==============================================================================

/*
sql for creating the extra table you need

create table feedsources(
id         int,
feed_url     varchar(255),
updated     int DEFAULT 0
);

*/


require('magpierss/rss_fetch.inc');
define(constantebot,1);
require "search_idx.php";


mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_name);


$sql_get_feeds="select id, feed_url, updated from feedsources";
$resultado=mysql_query($sql_get_feeds);

$ii=0;
while ( $row=mysql_fetch_array($resultado) ){
    $feed_array[$ii]["feed"]=$row["feed_url"];
    $feed_array[$ii]["id"]=$row["id"];
    $feed_array[$ii]["updated"]=$row["updated"];
    $ii++;
}

$num_posts=0;

foreach ($feed_array as $feed_array_element){
    
    $feed_last_update        =    $feed_array_element["updated"];
    $url                =    $feed_array_element["feed"];
    $feed_id            =    $feed_array_element["id"];
    $rss                 =    fetch_rss($url);    

    $new_last_update = $feed_last_update;
    
    foreach ( $rss->items as $item ) {
    
                $timenow    = time();
                $date_string     = $item["pubdate"];
                $date_posted     = strtotime($date_string);
                
                if($date_posted > $new_last_update){
                    $new_last_update=$date_posted;
                }
                
                if($date_posted <= $feed_last_update){
                    
                    break;
                }
                
                $num_posts++;
                $topic_subject        =    $item['title'];
                $poster            =     $newstbot_name;
                $topic_forum_id        =    $newsforum_id;
                $poster_id        =    $newsbot_id;;

                $post_message        =     mysql_escape_string($item['description']);
                $post_message        =    $post_message.
                "<br /><br /><a href=\"".$item["link"]."\">$follow_link_text</a>";
                
    
                
                $sql="
                    insert into topics
                        (subject,
                        poster,
                        posted,
                        forum_id,
                        last_post_id,
                        last_poster)
                    values
                        ('$topic_subject',
                        '$poster',
                        $timenow,
                        $topic_forum_id,
                        $timenow,
                        '$poster')";
                        
                mysql_query($sql);
                
                $topic_id = mysql_insert_id();
                
                $sql="
                    insert into posts                
                        (poster,
                        poster_id,
                        message,
                        hide_smilies,
                        posted,
                        topic_id)
                    values
                        ('$poster',
                        $poster_id,'"
                        ."$post_message"
                        ."',
                        1,
                        $timenow,
                        $topic_id)";
                
                mysql_query($sql);
                $last_post_id = mysql_insert_id();
         
                $sql="update topics set last_post_id=$last_post_id, last_post=$date_posted where id=$topic_id";
                echo "$sql <br>";
                mysql_query($sql);
                
                $sql="
                    update forums
                    set
                        num_posts=num_posts+1,
                        num_topics=num_topics+1,
                        last_post=$timenow,
                        last_post_id=$last_post_id,
                        last_poster='$poster'
                        
                    where
                        id=$topic_forum_id";
                
                mysql_query($sql);

                                $post_message=strip_tags($post_message);
                update_search_index('post', $last_post_id, $post_message);
                               
                
                
        }
        
        $sql2="update feedsources set updated=$new_last_update where id=$feed_id";
        mysql_query($sql2);
        echo "$sql2 <br>";
        
    }
    
    $sql3="update users set num_posts=num_posts+$num_posts where id=$newsbot_id";
    mysql_query($sql3);
?>

327

(8 replies, posted in PunBB 1.2 troubleshooting)

yep...
pretty interesting. Simple and killer smile

I have one more question thogh. I am using html in the rss news, i mean, i bypass the all parsings if posting news from rss so the orignal html can be rendered.
This is ok... but i guess i can't just index html source code. So i need to posted unparsed then parse it afterwards so it can be indexed.
So... i am a bit confused... i went throught the source code and i noticed the messages go through a lot oof parsing ( bbtags, html, autolink, etc )  , so i dont really know where to trigger the indexing.

like... will a parse_message($raw_html) be enough before indexing?
I checked the manual and its kind of weird.. isnt there any function that  simply takes away the html tags rather then enconding or scaping them?

328

(8 replies, posted in PunBB 1.2 troubleshooting)

OMG!
I had no idea... does this index every damn single word?

Ok... so what should i do? This sound prety logical, but i have zero experience on searches and indexes... ths whet i have in mind... Correct me if this is somthing that will pull my server down.

1. put all the words one by one in an array
2. Check if they exist, if they dont insert them
3. insert the search matches

now... sorry my inexperience... now.. is the "word" column unique? if it is i could just insert every word and let the unique restrition on the database level do the rest. Or should i "select ... where word='blabla' " and then check if any row is returned? That appears to take more time.

help!

EDIT: crap... didnt even red the first two lines of your post. lol. sorry. Anyway... i am still curious about all these searches are performed... so... if it's not to much effort i still what to know the answers to the questions i just made.

329

(8 replies, posted in PunBB 1.2 troubleshooting)

I am fetching news from rss feeds and post them as new posts. This is working pretty fine and was not so dificult to code.
Now i am facing some problems with the indexing. The posts are not indexed and therefore dont apear as search results.
An index update takes sometime. Now i dont have so much users/traffic, but i guess it can cause some errors if i have a lot of visitors online.

Any tips on how to optimize the updating process?
like... if i uncheck the "empty before update" ant then update will it only add stuff to the index?
can i do it via shell so i can automate the process with a crontab?

also... whats the index itself? is it a btree database index? is it a set of files? wich kind of files?

HitMan wrote:

Hmmm...
Posts are not deleted with user but they not see.

what do you mean. "but they not see"?

331

(6 replies, posted in PunBB 1.2 discussion)

Ok... i am starting this new board. This one has to be 100% ads suported so i cant just put some ads to make some extra income. I really need to optimize them.

Any ideas? banner? pop unders? text ads? in-text ads?
Anybody has any experience on this? like where should i put them? on the header on the right side? on a skyscraper on the side? betwin first and second post?
in my posts? in every first post?
in the anouncement box?

i thought a way that could generate high click rate would be replace the thre posts of every forum by ads text. Or maybe replace a forum title by ad links...

All ideas and shared experiences are wellcome.

332

(17 replies, posted in PunBB 1.2 discussion)

Ok... i tryed phorum and i am everything but satisfyed. It's a bit buggy and it lacks basic features. Its a bit similar concept to punbb but its soooo far back.

I think we are forgettig something here... isn't there big sites out there that use punbb? Like.... can anybody point me big and important features punbb doesnt suport? If i should give my opinion about punbb... well... the great thing its that its simple but its suted for heavy weight tasks.

333

(17 replies, posted in PunBB 1.2 discussion)

to be honest i am not shure if i agree or disagree with you madhater...

does it have to be necessarly like that? maybe. I confess i dont have enough experience to give a more complete opinion.

Maybe its the whole conception of punbb that is beter. It was made to be light, cleand, simple and fast. And it is. Being developed by one person might be the best choice after all. Then with small contributions from here and there it gets awsome. After some time it got more complete without sacrifying simplicity and speed. And if you want you can hack it or install this or that module.

I remember when it didnt have an avatar for example. Rickard then took the right decision of including it in the default instalation instead of getting stucked to his initial idea. This is just a small example about punbb good way of being.

phpbb tryed to be the most complete forum software and compete with vbulletin, but then they lack basic features like a proper user control panel.  Then invision came, then smf got so much more advanced... well... phpbb it had its time... maybe when version 3 is out... i myself dont even know really what to expect for version 3.

Punbb its by far the faster phorum system, it looks cool in its basyc instalation,  its code is dead simple to understand, it's costumizable, and besides all that now it got complete.

sorry to all the dudes found of all other board systems open source or not, punbb just rocks.

PS:punbb is made in sweden, i love that, for personal reasons wink

334

(2 replies, posted in PunBB 1.2 discussion)

i dont think the "phpbb guys" are the ones paying. I guess it should be those forum-hosting companies ad-based. Or even regular webhosting compnies with some one-click-install phpbb.

335

(6 replies, posted in PunBB 1.2 discussion)

lets  check that up.  tack så mycket!

EDIT:mmm... sorry not to contribut with this. I had a look at the other forums migration files and i figured out it would be some work. I cant get into that.

336

(6 replies, posted in PunBB 1.2 discussion)

Here it goes, i think its beter not to use the [ code ] tag to avoid the scroll.
now let me have a look on punbb structure.

BTW... how are these converters usualy made?
i would use simple

select whatever from phorum

followed by

insert pun_whatever in punbb

and loop that in a php script.

is it the recomended way? or should one make a .sql file find and replace or something?


--
-- Database: 'phorumstruct'
--

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_banlists'
--

CREATE TABLE phorum_banlists (
  id int(11) NOT NULL auto_increment,
  forum_id int(11) NOT NULL default '0',
  `type` tinyint(4) NOT NULL default '0',
  pcre tinyint(4) NOT NULL default '0',
  `string` varchar(255) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY forum_id (forum_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_files'
--

CREATE TABLE phorum_files (
  file_id int(11) NOT NULL auto_increment,
  user_id int(11) NOT NULL default '0',
  filename varchar(255) NOT NULL default '',
  filesize int(11) NOT NULL default '0',
  file_data mediumtext NOT NULL,
  add_datetime int(10) unsigned NOT NULL default '0',
  message_id int(10) unsigned NOT NULL default '0',
  link varchar(10) NOT NULL default '',
  PRIMARY KEY  (file_id),
  KEY add_datetime (add_datetime),
  KEY message_id_link (message_id,link)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_forum_group_xref'
--

CREATE TABLE phorum_forum_group_xref (
  forum_id int(11) NOT NULL default '0',
  group_id int(11) NOT NULL default '0',
  permission int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (forum_id,group_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_forums'
--

CREATE TABLE phorum_forums (
  forum_id int(10) unsigned NOT NULL auto_increment,
  `name` varchar(50) NOT NULL default '',
  active smallint(6) NOT NULL default '0',
  description text NOT NULL,
  template varchar(50) NOT NULL default '',
  folder_flag tinyint(1) NOT NULL default '0',
  parent_id int(10) unsigned NOT NULL default '0',
  list_length_flat int(10) unsigned NOT NULL default '0',
  list_length_threaded int(10) unsigned NOT NULL default '0',
  moderation int(10) unsigned NOT NULL default '0',
  threaded_list tinyint(4) NOT NULL default '0',
  threaded_read tinyint(4) NOT NULL default '0',
  float_to_top tinyint(4) NOT NULL default '0',
  check_duplicate tinyint(4) NOT NULL default '0',
  allow_attachment_types varchar(100) NOT NULL default '',
  max_attachment_size int(10) unsigned NOT NULL default '0',
  max_totalattachment_size int(10) unsigned NOT NULL default '0',
  max_attachments int(10) unsigned NOT NULL default '0',
  pub_perms int(10) unsigned NOT NULL default '0',
  reg_perms int(10) unsigned NOT NULL default '0',
  display_ip_address smallint(5) unsigned NOT NULL default '1',
  allow_email_notify smallint(5) unsigned NOT NULL default '1',
  `language` varchar(100) NOT NULL default 'english',
  email_moderators tinyint(1) NOT NULL default '0',
  message_count int(10) unsigned NOT NULL default '0',
  sticky_count int(10) unsigned NOT NULL default '0',
  thread_count int(10) unsigned NOT NULL default '0',
  last_post_time int(10) unsigned NOT NULL default '0',
  display_order int(10) unsigned NOT NULL default '0',
  read_length int(10) unsigned NOT NULL default '0',
  vroot int(10) unsigned NOT NULL default '0',
  edit_post tinyint(1) NOT NULL default '1',
  template_settings text NOT NULL,
  count_views tinyint(1) unsigned NOT NULL default '0',
  display_fixed tinyint(1) unsigned NOT NULL default '0',
  reverse_threading tinyint(1) NOT NULL default '0',
  inherit_id int(10) unsigned default NULL,
  PRIMARY KEY  (forum_id),
  KEY `name` (`name`),
  KEY active (active,parent_id),
  KEY group_id (parent_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_groups'
--

CREATE TABLE phorum_groups (
  group_id int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '0',
  `open` tinyint(3) NOT NULL default '0',
  PRIMARY KEY  (group_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_messages'
--

CREATE TABLE phorum_messages (
  message_id int(10) unsigned NOT NULL auto_increment,
  forum_id int(10) unsigned NOT NULL default '0',
  thread int(10) unsigned NOT NULL default '0',
  parent_id int(10) unsigned NOT NULL default '0',
  author varchar(37) NOT NULL default '',
  `subject` varchar(255) NOT NULL default '',
  body text NOT NULL,
  email varchar(100) NOT NULL default '',
  ip varchar(255) NOT NULL default '',
  `status` tinyint(4) NOT NULL default '2',
  msgid varchar(100) NOT NULL default '',
  modifystamp int(10) unsigned NOT NULL default '0',
  user_id int(10) unsigned NOT NULL default '0',
  thread_count int(10) unsigned NOT NULL default '0',
  moderator_post tinyint(3) unsigned NOT NULL default '0',
  sort tinyint(4) NOT NULL default '2',
  datestamp int(10) unsigned NOT NULL default '0',
  meta mediumtext NOT NULL,
  viewcount int(10) unsigned NOT NULL default '0',
  closed tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (message_id),
  KEY thread_message (thread,message_id),
  KEY thread_forum (thread,forum_id),
  KEY special_threads (sort,forum_id),
  KEY status_forum (`status`,forum_id),
  KEY list_page_float (forum_id,parent_id,modifystamp),
  KEY list_page_flat (forum_id,parent_id,thread),
  KEY post_count (forum_id,`status`,parent_id),
  KEY dup_check (forum_id,author,`subject`,datestamp),
  KEY forum_max_message (forum_id,message_id,`status`,parent_id),
  KEY last_post_time (forum_id,`status`,modifystamp),
  KEY next_prev_thread (forum_id,`status`,thread),
  KEY user_id (user_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_pm_buddies'
--

CREATE TABLE phorum_pm_buddies (
  pm_buddy_id int(10) unsigned NOT NULL auto_increment,
  user_id int(10) unsigned NOT NULL default '0',
  buddy_user_id int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (pm_buddy_id),
  UNIQUE KEY userids (user_id,buddy_user_id),
  KEY buddy_user_id (buddy_user_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_pm_folders'
--

CREATE TABLE phorum_pm_folders (
  pm_folder_id int(10) unsigned NOT NULL auto_increment,
  user_id int(10) unsigned NOT NULL default '0',
  foldername varchar(20) NOT NULL default '',
  PRIMARY KEY  (pm_folder_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_pm_messages'
--

CREATE TABLE phorum_pm_messages (
  pm_message_id int(10) unsigned NOT NULL auto_increment,
  from_user_id int(10) unsigned NOT NULL default '0',
  from_username varchar(50) NOT NULL default '',
  `subject` varchar(100) NOT NULL default '',
  message text NOT NULL,
  datestamp int(10) unsigned NOT NULL default '0',
  meta mediumtext NOT NULL,
  PRIMARY KEY  (pm_message_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_pm_xref'
--

CREATE TABLE phorum_pm_xref (
  pm_xref_id int(10) unsigned NOT NULL auto_increment,
  user_id int(10) unsigned NOT NULL default '0',
  pm_folder_id int(10) unsigned NOT NULL default '0',
  special_folder varchar(10) default NULL,
  pm_message_id int(10) unsigned NOT NULL default '0',
  read_flag tinyint(1) NOT NULL default '0',
  reply_flag tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (pm_xref_id),
  KEY xref (user_id,pm_folder_id,pm_message_id),
  KEY read_flag (read_flag)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_search'
--

CREATE TABLE phorum_search (
  message_id int(10) unsigned NOT NULL default '0',
  forum_id int(10) unsigned NOT NULL default '0',
  search_text mediumtext NOT NULL,
  PRIMARY KEY  (message_id),
  KEY forum_id (forum_id),
  FULLTEXT KEY search_text (search_text)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_settings'
--

CREATE TABLE phorum_settings (
  `name` varchar(255) NOT NULL default '',
  `type` enum('V','S') NOT NULL default 'V',
  `data` text NOT NULL,
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_subscribers'
--

CREATE TABLE phorum_subscribers (
  user_id int(10) unsigned NOT NULL default '0',
  forum_id int(10) unsigned NOT NULL default '0',
  sub_type int(10) unsigned NOT NULL default '0',
  thread int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (user_id,forum_id,thread),
  KEY forum_id (forum_id,thread,sub_type)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_user_custom_fields'
--

CREATE TABLE phorum_user_custom_fields (
  user_id int(11) NOT NULL default '0',
  `type` int(11) NOT NULL default '0',
  `data` text NOT NULL,
  PRIMARY KEY  (user_id,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_user_group_xref'
--

CREATE TABLE phorum_user_group_xref (
  user_id int(11) NOT NULL default '0',
  group_id int(11) NOT NULL default '0',
  `status` tinyint(3) NOT NULL default '1',
  PRIMARY KEY  (user_id,group_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_user_newflags'
--

CREATE TABLE phorum_user_newflags (
  user_id int(11) NOT NULL default '0',
  forum_id int(11) NOT NULL default '0',
  message_id int(11) NOT NULL default '0',
  PRIMARY KEY  (user_id,forum_id,message_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_user_permissions'
--

CREATE TABLE phorum_user_permissions (
  user_id int(10) unsigned NOT NULL default '0',
  forum_id int(10) unsigned NOT NULL default '0',
  permission int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (user_id,forum_id),
  KEY forum_id (forum_id,permission)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table 'phorum_users'
--

CREATE TABLE phorum_users (
  user_id int(10) unsigned NOT NULL auto_increment,
  username varchar(50) NOT NULL default '',
  `password` varchar(50) NOT NULL default '',
  cookie_sessid_lt varchar(50) NOT NULL default '',
  sessid_st varchar(50) NOT NULL default '',
  sessid_st_timeout int(10) unsigned NOT NULL default '0',
  password_temp varchar(50) NOT NULL default '',
  email varchar(100) NOT NULL default '',
  email_temp varchar(110) NOT NULL default '',
  hide_email tinyint(1) NOT NULL default '0',
  active tinyint(1) NOT NULL default '0',
  user_data text NOT NULL,
  signature text NOT NULL,
  threaded_list tinyint(4) NOT NULL default '0',
  posts int(10) NOT NULL default '0',
  admin tinyint(1) NOT NULL default '0',
  threaded_read tinyint(4) NOT NULL default '0',
  date_added int(10) unsigned NOT NULL default '0',
  date_last_active int(10) unsigned NOT NULL default '0',
  last_active_forum int(10) unsigned NOT NULL default '0',
  hide_activity tinyint(1) NOT NULL default '0',
  show_signature tinyint(1) NOT NULL default '0',
  email_notify tinyint(1) NOT NULL default '0',
  pm_email_notify tinyint(1) NOT NULL default '1',
  tz_offset tinyint(2) NOT NULL default '-99',
  is_dst tinyint(1) NOT NULL default '0',
  user_language varchar(100) NOT NULL default '',
  user_template varchar(100) NOT NULL default '',
  moderator_data text NOT NULL,
  moderation_email tinyint(2) unsigned NOT NULL default '1',
  PRIMARY KEY  (user_id),
  UNIQUE KEY username (username),
  KEY active (active),
  KEY userpass (username,`password`),
  KEY sessid_st (sessid_st),
  KEY cookie_sessid_lt (cookie_sessid_lt),
  KEY activity (date_last_active,hide_activity,last_active_forum),
  KEY date_added (date_added),
  KEY email_temp (email_temp)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

337

(6 replies, posted in PunBB 1.2 discussion)

ok..... it looks like we are bad luck. There is no... and i dont think it will ever be. Phorum is getting less and less popular. I think punbb totaly bangged in its popularity while phorum got stuck to some fixed mind ideas. Pity i  choosed phorum when i set up my site's board.

And know i dont feel like writing a corvertor script as. That would be a lot of hard work and wouldnt be used by so many ppl as phorum is being used by a few resistent guys only ( like me ).
Besides, as far as i know phorum documentation doesnt even has a table reference. It's not critical i know, but i myself prefer to develop whatever it is suported by good documentation.

So... i think its left for phorum users to open a new punbb board.

I think i will insert the existing users in my new punbb forum and leave my phorum instalation read only;

338

(7 replies, posted in Programming)

Its working!

its a pitty that a lot of sites say "RSS 2.0" but then each  one uses a diferent structure...

So far is working ok... just need to fix some relationships updated... they are more than i thought...

i will stop and do some school stuff now... i get back to it within a week or something.

thanks for the help... appreciated.

339

(7 replies, posted in Programming)

thanks guys, i actualy had updated the viewtopic, but i had a coma out of place...

i leave the date check for the last... lets see what do i need to update more

340

(7 replies, posted in Programming)

first of all thenks for the help.
Though i didnt understand some stuff.

line 186? my script only has about 70 lines... wich query are you talking about? the first? the second? the third?

i also didnt understand the p.html hint... are you refering to the new field i created to check if the message has html or not? i am not using that field in any SELECT sql command... where should i have a SELECT and what for?

341

(7 replies, posted in Programming)

it ouputs something like this

<p><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://photos1.blogger.com/blogger/1179/1741/1600/Aztecs%20Live%20-%20Front.0.jpg"><img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/1179/1741/400/Aztecs%20Live%20-%20Front.0.jpg" border="0" /></a><strong><span style="font-size:85%;">Size: 80.6 MB</span></strong><br /><strong><span style="font-size:85%;">Bitrade: 256</span></strong><br /><strong><span style="font-size:85%;">mp3</span></strong><br

342

(7 replies, posted in Programming)

Ok... i wrotes this little script... but the html is not well parsed.
I am bypassing the html special chars the way elbecko told me here

this is just the beggining, but is not working so well... i guess i alsoforgot to update some post counts but i go into that later.... by now i would like to have the html well parsed...

i picked a feed with a lot of html on purpose.

can anybody point me where and with parsing am i missing?

thx

<?
require('magpierss/rss_fetch.inc');

$db_host = 'localhost';
$db_name = 'my_db';
$db_username = 'imacooluser';
$db_password = 'mypass';

mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_name);

$url="http://chrisgoes.blogspot.com/rss.xml";
$rss = fetch_rss($url);


foreach ( $rss->items as $item ) {
            
            $topic_subject        =    $item['title'];
            $poster                =     "postbot";
            $timenow            =    time();
            $topic_forum_id        =    2;
            $post_message        =     mysql_escape_string($item['description']);
            $poster_id            =    3;

            
            $sql="
                insert into topics
                    (subject,
                    poster,
                    posted,
                    forum_id,
                    last_post_id,
                    last_poster)
                values
                    ('$topic_subject',
                    '$poster',
                    $timenow,
                    $topic_forum_id,
                    $timenow,
                    '$poster')";
                    
            mysql_query($sql);
            
            $topic_id = mysql_insert_id();
            
            $sql="
                insert into posts                
                    (poster,
                    poster_id,
                    message,
                    html,
                    hide_smilies,
                    posted,
                    topic_id)
                values
                    ('$poster',
                    $poster_id,
                    '$post_message',
                    1,
                    1,
                    $timenow,
                    $topic_id)";
            
            mysql_query($sql);
            $last_post_id = mysql_insert_id();
     
            $sql="update topcics set last_post_id=$last_post_id where id=$topic_id";
            mysql_query($sql);
    }
    ?>

343

(7 replies, posted in Programming)

yup... i meant open source... ok... so it doesnt appear to have so many advanteges over mysql when the last is present

344

(2 replies, posted in PunBB 1.2 show off)

yep... add a open forum, just so we can se.. it looks cool

345

(7 replies, posted in Programming)

I was reading some of my web hosting's provider when i red under the php instalations features that sqlite was distributed with php5.
First i thought that was very practical, but then... i thoght, everybody suports mysql nowadays anyway...

so... what about it? when do you recomend it and why? I love mysql, its OS, fast like hell, swedish, big community, etc etc...

It appears that sqlite is the biggest alternative at the moment as postgres is not being suported by so many hosting companies, at least mine (dreamhost) doesn't .

So what about it? The whole concept of writing on the hard drive all the time sounds slow... dunno...

does anybody use it? why?

ok... i searched around and it looks like there is some ppl doing it already.
It looks easy to do using this...
http://wiki.splitbrain.org/wiki:auth:punbb
but i would like to turn the magic quotes off.

there is a module on punres that uses some doku.php file but i dont understand really what does it do.

any sugestions or advices on this integration please help.

I am runing PunBB 1.2.12...
it would be cool to make it possible for the user register on the wiki(forum) without knowing that there is a forum(wiki). This way i could get both audiences, the ones that like forums rather than wikis and the ones that...

thanks in advance

mmm...
i the text goes directly to the database... al the parsing is done while showing the topic.

i think i will bypass the parsing if the user=.... and postcount=1

<b>blab</b>

EDIT: ok... al the html tags' special chars are converted to entites...

i guess if i use an external script writen by me i can insert html code itself ( not entities ) so the content can display with formating.

i am working on this rss bot that posts 1 rss item as a new thread so user can discuss news fetched from a feed.
Some rss come with html formating. Wich is actualy cool.

I was wondering.. how and where in the code does the html check takes place?
i dont want to allow html on the user posts but i want to keep the html from the feed on the opening message.

can i simply inser the feed text with html using an external script and disallow html in that same forum?

mmm... might get very heavy for a bigger forum.
i think a database its like mandatory for this mod.