TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,234
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 281
  • Total: 281

Create a special database field and funtionality to for user submited articles

Started by shawnlg, March 18, 2008, 06:34:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

shawnlg

As the title says I want to create funtionality to allow users to submit articles to the site and then allow the site to hold them until reviews.  Once reviewed I want it to submit it to the articles directory.

I want anyone to be able to submit to it as along as they are a user.
I dont want them to have access to the other submited articles.
I want a drop down box with the current categories.
I want to add additional form fields that users can fill in.

Currently the form on this site (isted below) sends me the info to my mail box

http://www.scifiandgod.com/content/index.php?page=7811

Instead I want it do funtion as I listed above.  Please let me know if someone can give me direction in developing such a creature.  I am willing to do the work involved I just need some direction.  If you wish to PM me on it please feel free or post it here.

As far as I know the funtionality isnt existant.  I searched for it but might have missed it. I am hoping to create it with help.  I think others could use it to.

IchBin

You're basically asking for an additional article system to be added. While its possible, it is way out of the scope of support here. I don't have time to do such a thing, so good luck. :)

shawnlg

Thanks..  I figured so, is there a way you can pm me and give me an idea of which files and sql needs to be touched and I will figure it out from there. 

IchBin

TPortal.php, TPortalAdmin.php, TPortalAdmin.template.php, TPortal.template.php. I couldn't  tell you what SQL queries, as you would have to add your own tables and/or rows with the information that "you" need. My best advice would be to mimic what is already done but use different tables etc.

shawnlg

Perfect thank you.  I will post my changes if I get this to work.

shawnlg

I am making some progress on how I am going to make this work the simplest way possible and have came to the conclusion that if I can just add five extra fields on the add article page and the the display of the page I can make this work.

I have added the five extra fields in the database and now I just need to figure out how to make them display on both of those pages.

I have isolated the piece of text I need to replicate..
<textarea name="tp_article_body'.$mg['id'].'" id="tp_article_body'.$mg['id'].'" style="width: 95%; height: 300px;" wrap="auto">'.$mg['body'].'</textarea>
';

On line 2359

However when I replicate it on the very next line by doing something like this I get an error.
<textarea name="tp_Synopsis'.$mg['id'].'" id="tp_Synopsis'.$mg['id'].'" style="width: 95%; height: 200px;" wrap="auto">'.$mg['body'].'</textarea>
';

Can somebody help me with my sytax and tell me if I am on the right track.  Thanks in advance.

JPDeni

This may be too obvious, but I have to post what I see.

Try starting your line (the one you're adding) with


echo '




shawnlg

Duh..  yeah..  that eliminated the error.  Now I just need to figure out how to get it to show up on the page.

shawnlg

I am wondering for someone who has gotten into this can tell me if I am on the right track.  Here is my line of thinking in adding an additional field in the add and edit  article section..

I was thinking that if I replicated and changed anywhere I found  tp_article_body code I could duplicate the functionality and add that additional field.

Anyone know if this has been done?  I have checked out the forum and didn't find that it was so, but I might have missed it.  Thanks!

IchBin

I have not seen anyone add any functionality to articles like this Shawnlg. So I don't think anyone could tell you how to do it.

This website is proudly hosted on Crocweb Cloud Website Hosting.