Date:  04/10/2012 06:18:29 PM Msg ID:  004453
From:  Ali Koumaiha Thread:  004449
Subject:  Re: Wooohoo.. Free forum written in FoxWeb
Update:
-Added logo
-created a forumheader.fwx (that gets called from every page) servers for headers, displaying logo, links etc.
-created reply page
-created sql statement to get topic counts on main page. (added procedure DisplayForum() to the biz object class

i am going to do couple minor cosmetics then, i am going to write how to install/download the forum.

1- the FWX scripts
2- the Data files
3- the images/css/javascripts (usually in the wwwroot folder)
4- some settings in fw_enter.prg and fw_exit.prg

probaly couple more days and it should be good to go.. i just hope someone would be able to help test it. before i release it in a zip file and post it in the public domain.


and voila..

stay tuned...

Sent by Ali Koumaiha on 04/10/2012 02:12:42 PM:
FoxWebforum beta class.

DEFINE CLASS FoxWebForum as Custom
 nForumID  = 0
 cErrorMsg  = ""
 nTopicID = 0
 cDataPath   = '\FoxWeb\Portal\forum\data\'
 cSubject = ''
 cMessage = ''
 
 
 PROCEDURE init()
  this.OpenData()
 ENDPROC
 
 PROCEDURE OpenData()
  lcDataPath = this.cDataPath
  TRY
   if not used("FoxWebforum")
    use (lcDataPath) + "FoxWebforum" in 0
   endif
   if not used("FoxWebforumDetails")
    use (lcDataPath) + "FoxWebforumDetails" in 0
   endif
   if not used("FoxWebforumTopics")
    use (lcDataPath) + "FoxWebforumTopics" in 0
   endif
  CATCH TO loexp
   response.write(loExp.message)
  ENDTRY
 ENDPROC
 PROCEDURE GetForumDetail()
   LOCAL lnForum, lcCursor
   lcCursor = SYS(2015)
   
   lnForum = this.nForumID
   IF lnForum = 0
    this.cErrorMsg = "Invalid forum ID selected"
    RETURN ""
   ENDIF
   
   select FoxWebforum
   set order to iid
   if not seek(lnForum)
    this.cErrorMsg = "Forum ID was not found."
    RETURN ""
   endif
 

    
   select FoxWebforumDetails
   set order to fk_forum
   if seek(lnforum)
    replace Viewcount with Viewcount + 1
   endif

   select FoxWebForumDetails.*,;
    FoxWebForum.Forumtitle ;
    from FoxWebForumDetails ;
    left outer join FoxWebForum ;
    on FoxWebForumDetails.fk_forum = FoxWebForum.IID ;
    where fk_forum = lnforum ;
    order by FoxWebForumDetails.LastPost desc ;
    into cursor (lcCursor)

   RETURN (lcCursor)


 ENDPROC
 PROCEDURE Gettopic()
  LOCAL lnTopic, lcCursor
  lnTopic = this.nTopicID
  lcCursor = SYS(2015)
  
  SELECT FoxWebForumDetails
  SET ORDER TO IID
  IF SEEK(lnTopic)
   REPLACE ViewCount WITH ViewCount + 1
  ENDIF
  
  
  select FoxWebForumtopics.*,;
   FoxWebForum.Forumtitle, ;
   foxWebforum.IID as Forum,;
   foxWebForumDetails.Topic ;
   from ;
    FoxWebForumTopics ;
   Left outer join FoxWebForumDetails ;
    on FoxWebForumtopics.fk_topic = FoxWebForumDetails.IID ;
   left outer join FoxWebForum ;
    on FoxWebForumDetails.fk_forum = FoxWebForum.IID ;
   where fk_topic = lntopic ;
   order by FoxWebForumTopics.PostDate ;
   into cursor (lcCursor)
  
  RETURN (lcCursor)

 ENDPROC
 PROCEDURE AddNewPost()
  LOCAL lnForum, lcMessage, lcSubject, lnTopicIID
  
  lnForum = this.nForumID
  lcMessage = this.cMessage
  lcSubject = this.cSubject
  
  select FoxWebforumdetails
  append blank
  replace fk_forum with lnforum,;
   topic with lcSubject,;
   Adduser with auth.userid,;
   LastPost with datetime(),;
   LastPostBy with auth.userid,;
   AddDate with datetime()
  
  lntopiciid = FoxWebForumDetails.iid
  
  select FoxWebForumTopics
  append blank
  repl fk_topic with lntopiciid,;
   postdate with datetime(),;
   PostUser with auth.userid,;
   Message with lcMessage
 
  RETURN
 
 ENDPROC
 PROCEDURE AddNewReply()
  LOCAL lnForum, lcMessage, lcSubject, lnTopicIID
  
  lnTopic = this.nTopicID
  lcMessage = this.cMessage
  
  
  SELECT FoxWebForumDetails
  SET ORDER TO IID
  IF SEEK(lnTopic)
   REPLACE ReplyCount WITH ReplyCount + 1
  ENDIF
  
  select FoxWebForumTopics
  append blank
  repl fk_topic with lntopic,;
   postdate with datetime(),;
   PostUser with auth.userid,;
   Message with lcMessage
 
  RETURN
 
 ENDPROC
 
ENDDEFINE  


Sent by Ali Koumaiha on 04/09/2012 06:07:34 PM:
A user forum completely written in FoxWeb (along with some javascripts and css) Cool

-uses free tables (but, if you want you can do sql tables i guess.. i just didn't want that)
-5 pages or so (for now) (view forums, view topics, post new topic)
-the way i have it on my server is protected (auth.authenticate)
-uses WYSIWYG editor from tiny_mce

if anyone intrested it, i will zip all the files with instructions.  probably will take you 5 minutes to change some path (to the data folder etc..)

you can do whatever you want with it. free

i know alot of people ask if anyone has a forum for foxweb to be used.. well, here it is..
give it a test drive and let me know what you think.

http://www.ezcellpos.com/forum/index.fwx

username: ali
password: ali

PS:
I DIDN'T CREATE THE REPLY PAGE YET (WORKING ON IT)

Sorry, didn't create a register page
No fancy graphics yet
but, you can do what you want with it if you want the source codes
Might get an error or two (again, i just slapped it arround today)


Everything else should be working.