SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 5th, 2003, 11:53 AM
taintedutopia taintedutopia is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Calgary ab canada
Posts: 6 taintedutopia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to taintedutopia Send a message via AIM to taintedutopia Send a message via Yahoo to taintedutopia
Multiple Page Article Submission System - Aid

Hey guys... I'm having a bit of an issue here... I'm trying to create a mutli-page system, and I thought I'd be able to use the article here on devarticles... but alas, the javascript doesn't work in Mozilla.

I want to make a system that will allow registered users to submit articles... These articles are based into five different catagories. Articles, rants, tutorials, website reviews and interviews...

See, I have well figured out how to submit to the database.... but I need to be able to have the user submit articles on the fly... And he needs to be able to choose where they will break the pages... I have considered just putting articles into one page, but when an inteview is 10 Windows Word pages... well.. you understand.
PHP Code:
<? 
require_once("PageClass.inc.php"); 

$svr = new QueryClass(); 
$mpage = new PageClass($svr); 
?> 
<form> 
<table width="750" cellpadding="0" cellspacing="1" border="0" align="center"> 
<tr> 
<td colspan="3" class="prof_header_one">Submit Article</td> 
</tr> 
<tr> 
<td class="profile_short">Title:</td> 
<td class="profile_help">
[<a href="javascript://" onmouseover="popup(1)" onmouseout="popout()">?</a>]
</td> 
<td class="profile_long"> 
<input type="text"> 
</td> 
</tr> 
<tr> 
<td class="profile_short">Category:</td> 
<td class="profile_help">
[<a href="javascript://" onmouseover="popup(1)" onmouseout="popout()">?</a>]
</td> 
<td class="profile_long"> 
<select> 
<option>Interview</option> 
<option>Tutorial</option> 
<option>Article</option> 
<option>Website Review</option> 
<option>Rant</option> 
</select> 
</td> 
</tr> 
<tr> 
<td class="profile_short">Cross Browser:</td> 
<td class="profile_help">
[<a href="javascript://" onmouseover="popup(1)" onmouseout="popout()">?</a>]
</td> 
<td class="profile_long"> 
<select> 
<option>No</option> 
<option>Yes</option> 
<option>N/A</option> 
</select> 
</td> 
</tr> 
<tr> 
<td class="profile_short">Keywords:</td> 
<td class="profile_help">
[<a href="javascript://" onmouseover="popup(1)" onmouseout="popout()">?</a>]
</td> 
<td class="profile_long"> 
<input type="text"> 
</td> 
</tr> 
<tr> 
<td class="profile_short">Original Author:</td> 
<td class="profile_help">
[<a href="javascript://" onmouseover="popup(1)" onmouseout="popout()">?</a>]
</td> 
<td class="profile_long"> 
<input type="text"> 
</td> 
</tr> 
<tr> 
<td class="profile_short">Summary:</td> 
<td class="profile_help">
[<a href="javascript://" onmouseover="popup(1)" onmouseout="popout()">?</a>]
</td> 
<td class="profile_long"> 
<textarea name=""></textarea> 
</td> 
</tr> 
<tr> 
<td class="profile_short">Content:</td> 
<td class="profile_help">
[<a href="javascript://" onmouseover="popup(1)" onmouseout="popout()">?</a>]
</td> 
<td class="profile_long"> 
<textarea name=""></textarea> 
</td> 
</tr> 
</table> 
</form> 

<? 
$mpage
->ClosePage(); 
?>

If I wanted to just add one page articles, this would be easy...

Code:
PHP Code:
if($submitarticle

$sql "insert into Articles (Title, Category, UserName,
 UserID, CrossBrowser, Keywords, OriginalAuthor,
 Summary, Content, Date)

values ("
$title", "$category", "$mpage->RealName",
 "
$mpage->IdNum", "$crossbrowser", "$keywords", 
"
$original", "$summary", "$content", NOW())"

$svr->DoQuery($sql); 

But I need to figure out how to split content into multiple pages.

I have debated a database table, something like this:

Code:
PHP Code:
 CREATE TABLE Articles 
Id int(11NOT NULL auto_increment
Title varchar(250) default NULL
Keywords varchar(250) default NULL
UserName varchar(100) default NULL
UserId varchar(50) default NULL
Author varchar(250) default NULL
Summary text
Content text
Content2 text
Content3 text
Content4 text
Content5 text
Sent datetime default NULL
Views int(14NOT NULL default '0'
MaxViews int(14NOT NULL default '0'
PRIMARY KEY (Id
TYPE=MyISAM

But that would mean I would have five text areas... This doesn't make me too happy...

So what I would REALLY like to do is have a user start an article... and then be able to add pages to the article as much as needed (within reason).

On submit, it would post the article and pages to the database. Then on something like view.php, I would use an if statement to echo the "next page" and whatnot, that won't be hard at all...

My hardest part is making a user friendly way to submit multi-page articles.

AAAAAAAARG! Still no idea...

Last edited by taintedutopia : May 5th, 2003 at 11:55 AM.

Reply With Quote
  #2  
Old May 5th, 2003, 12:12 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
provide 1 form,...store each content field in a session var.

PHP Code:
for ($i 1$i <= sizeof($_SESSION['article']); $i++)
{
     
$q "insert into article_pages ... "



hope this helps
__________________
-- Jason

Reply With Quote
  #3  
Old May 5th, 2003, 12:21 PM
taintedutopia taintedutopia is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Calgary ab canada
Posts: 6 taintedutopia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to taintedutopia Send a message via AIM to taintedutopia Send a message via Yahoo to taintedutopia
*shakes head* I appreciate your help sir.. but my PHP is still horrible.. I'm not really sure how I'd do something like that...

I'll continue looking... *grins* I've been working on this a week...

Thank you, very much.

-Shade

Reply With Quote
  #4  
Old May 5th, 2003, 02:34 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
<hint>Look into hidden html forms</hint>

<input type="hidden" value="...">

Reply With Quote
  #5  
Old May 6th, 2003, 12:30 AM
taintedutopia taintedutopia is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Calgary ab canada
Posts: 6 taintedutopia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to taintedutopia Send a message via AIM to taintedutopia Send a message via Yahoo to taintedutopia
Thanks for all your help... I have been able to crack it.

PHP Code:
if($submitarticle)
   {

   
$sql "insert into Articles (Title, Category, CrossBrowser, Keywords, UserName, UserId, Author, Summary, Sent)
              values (\"$title\", \"$category\", \"$crossbrowser\", \"$keywords\", \"$mpage->RealName\", \"$mpage->IdNum\", \"$author\", \"$summary\", NOW())"
;
   
$svr->DoQuery($sql); 
   
$id mysql_insert_id(); 
   
   
$pages split("###"$content); 
 
   for (
$x=0$x sizeof($pages); $x++) 
     { 
       
$pagenumber $x 1;
       
$content $pages[$x]; 
    
       
$sql "insert into ArticlePages (Id, ArticlePage, Content)
       values (\"$id\", \"$pagenumber\", \"$content\")"
;
   
$svr->DoQuery($sql);    
     }
   } 


Again, thanks.

-Shade

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Multiple Page Article Submission System - Aid


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway