Discussion:
[Phpslash-devel] story import
Matt Wiseman
2004-10-05 04:25:52 UTC
Permalink
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
-------------------------
WebMaster: Shoggoth.net
WebMonkey: Chaosium.com
All around weirdo
Luis M
2004-10-05 11:54:05 UTC
Permalink
Post by Matt Wiseman
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
Matt Wiseman
2004-10-06 03:12:09 UTC
Permalink
You got any documentation on the addstory() call?
Post by Luis M
Post by Matt Wiseman
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
https://lists.sourceforge.net/lists/listinfo/phpslash-devel
Luis M
2004-10-06 08:53:20 UTC
Permalink
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.
Post by Matt Wiseman
You got any documentation on the addstory() call?
Post by Matt Wiseman
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
Luis M
2004-10-08 08:10:08 UTC
Permalink
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.
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
Peter Cruickshank
2004-10-08 08:46:14 UTC
Permalink
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
Joe Stewart
2004-10-08 09:06:24 UTC
Permalink
Post by Luis M
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.
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.
Post by Luis M
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
Post by Luis M
--
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
Loading...