Thread: RE: [Phpslash-devel] story import
Brought to you by:
joestewart,
nhruby
From: Luis M <le...@ho...> - 2004-10-05 13:49:58
|
>I'm running the latest version of slash and am trying to import stories >from another system into it. >I can pull stories no problem, but if I just insert them into >psl_stories everything breaks. What's the proper way for me to do this? > >-- >Matt "TrollBoy" Wiseman You might have to check the form for creating new stories and see what fields are required for every story. Then write you own script that use the addstory() call from the classes ;-) Joe can correct me on this, but there are many variables that need to be set/modified/increased when a new story is added. So, instead of trying to write to the db directly, you are better off trying to use a PHP script (from the command line maybe) that does this for you using the existing API. ----)(----- Luis Mondesi System Administrator LatinoMixed.com "We think basically you watch television to turn your brain off, and you work on your computer when you want to turn your brain on" -- Steve Jobs in an interview for MacWorld Magazine 2004-Feb No .doc: http://www.fsf.org/philosophy/no-word-attachments.es.html |
From: Matt W. <tro...@sh...> - 2004-10-06 05:10:09
|
You got any documentation on the addstory() call? On Tue, 2004-10-05 at 09:28, Luis M wrote: > >I'm running the latest version of slash and am trying to import stories > >from another system into it. > >I can pull stories no problem, but if I just insert them into > >psl_stories everything breaks. What's the proper way for me to do this? > > > >-- > >Matt "TrollBoy" Wiseman > > You might have to check the form for creating new stories and see what > fields are required for every story. Then write you own script that use the > addstory() call from the classes ;-) > > Joe can correct me on this, but there are many variables that need to be > set/modified/increased when a new story is added. So, instead of trying to > write to the db directly, you are better off trying to use a PHP script > (from the command line maybe) that does this for you using the existing API. > > ----)(----- > Luis Mondesi > System Administrator > LatinoMixed.com > > "We think basically you watch television to turn your brain off, and you > work on your computer when you want to turn your brain on" -- Steve Jobs in > an interview for MacWorld Magazine 2004-Feb > > No .doc: http://www.fsf.org/philosophy/no-word-attachments.es.html > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Phpslash-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpslash-devel > > |
From: Luis M <le...@gm...> - 2004-10-06 05:29:04
|
Sorry i use the term "addstory" instead of "newstory" (from Story_admin.class). But in any case, you need to use "savestory" from Story_base.class (include/modules/story directory). Essentially, you could simply do: Starting from line 676, these are the variables you will need in an $array: $q = "INSERT INTO psl_story (story_id, user_id, title, order_no, dept, intro_text, body_text, date_available, hits, topic_cache, story_options) VALUES ('$ary[story_id]', '$ary[author_id]', '$ary[title]', '$ary[order_no]', '$ary[dept]', '$ary[intro_text]', '$ary[body_text]', $ary[timestamp], '0', '', '$serial_opts')"; // debug("Story_base::saveStory: insert query",$q); $this->db->query($q); $cmtcount = "INSERT INTO psl_commentcount (count_id, count) VALUES ('$ary[story_id]', 0)"; ... The psl documentation for developers could help you further. I know there is a link for it in php-slash.org, but I don't recall it. In any case, there is a .sgml file inside the "doc" directory that contains the information you need. On Wed, 06 Oct 2004 01:11:16 -0400, Matt Wiseman <tro...@sh...> wrote: > You got any documentation on the addstory() call? > > > On Tue, 2004-10-05 at 09:28, Luis M wrote: > > >I'm running the latest version of slash and am trying to import stories > > >from another system into it. > > >I can pull stories no problem, but if I just insert them into > > >psl_stories everything breaks. What's the proper way for me to do this? -- ----)(----- Luis M System Administrator LatinoMixed.com "We think basically you watch television to turn your brain off, and you work on your computer when you want to turn your brain on" -- Steve Jobs in an interview for MacWorld Magazine 2004-Feb No .doc: http://www.fsf.org/philosophy/no-word-attachments.es.html |
From: Luis M <le...@gm...> - 2004-10-08 06:49:32
|
commenting those out in config.php didn't do it? i thought that's all you needed to do. Did you check config.ini.php ? I've never tried doing that. Check with us in #phpslash IRC channel during EST day time hours :-) Joe, Mike and I are always there. On Thu, 07 Oct 2004 15:49:23 -0400, Matt Wiseman <tro...@sh...> wrote: > > Thanks I'll get on that! In the mean time, is there an easy way to turn > things off? > > I need to disable login an Add story from the navbar, and need to kill > off the comments system.. I THOUGHT I killed comments in config.php, > but alas they're still there. > > -- > Matt "TrollBoy" Wiseman > ------------------------- > WebMaster: Shoggoth.net > WebMonkey: Chaosium.com > All around weirdo > > -- ----)(----- Luis M System Administrator LatinoMixed.com "We think basically you watch television to turn your brain off, and you work on your computer when you want to turn your brain on" -- Steve Jobs in an interview for MacWorld Magazine 2004-Feb No .doc: http://www.fsf.org/philosophy/no-word-attachments.es.html |
From: Peter C. <li...@cr...> - 2004-10-08 10:35:40
|
AFAIK, you can disable commenting functionality from config.ini.php, but there are a few places where you have to remove comment stuff (blocks, links) from the templates. I think that's mostly been done in the ShankZen skin. I've set up a few sites with the comment system complete removed, so it is possible. P |
From: Joe S. <joe...@us...> - 2004-10-08 11:01:08
|
On Fri, Oct 08, 2004 at 02:49:20AM -0400, Luis M wrote: > commenting those out in config.php didn't do it? i thought that's all > you needed to do. Did you check config.ini.php ? > I've never tried doing that. Check with us in #phpslash IRC channel > during EST day time hours :-) Joe, Mike and I are always there. > > > On Thu, 07 Oct 2004 15:49:23 -0400, Matt Wiseman <tro...@sh...> wrote: > > > > Thanks I'll get on that! In the mean time, is there an easy way to turn > > things off? > > > > I need to disable login comment out the Login navbar entries in config.php. > > an Add story from the navbar, > > and need to kill > > off the comments system.. I THOUGHT I killed comments in config.php, > > but alas they're still there. > > Comment out the Submission module in config.ini.php. Just commenting out the link in the navbar would allow the submission.php url to still work. Same for Comment except as Peter said there are a few links in the templates to the comments. Joe > > -- > > Matt "TrollBoy" Wiseman > > ------------------------- > > WebMaster: Shoggoth.net > > WebMonkey: Chaosium.com > > All around weirdo > > > > > > > -- > ----)(----- > Luis M > System Administrator > LatinoMixed.com > > "We think basically you watch television to turn your brain off, and > you work on your computer when you want to turn your brain on" -- > Steve Jobs in an interview for MacWorld Magazine 2004-Feb > > No .doc: http://www.fsf.org/philosophy/no-word-attachments.es.html > |