|
Cookbook /
FoxForum-CommentsBack to FoxForum Discussion, comments, questions etc. about FoxForumPut your latest comment at the top please!(3-Oct-2008)
Fox Forum Right-to-Left. It seems some letters of the alphabet, like the 'mim' (م), are causing problems when included in the topicname, causing the main text to come out as {�ال.ForumAr}. If I type a subject with latin letters, the page works fine. Do you have any suggestions on how to make the forum work better with rtl languages? (I guess the easiest fix would be to give an alternative name to the topic pages, based on FoxCount, for instance, instead of the subject typed in Arabic.) - Regards, VG. I am out of my depth here, never had any experience with RTL or arabic. Perhaps the best is to modify the form creating new topics, so that perhaps a purely number based name is used, or a ISO-date and number combination. Then have the arabic topic as input for the page title. For serial names generated through a markup expression please see PowerTools#serialname. For apurely numeric page name I think the form of Forum.CreateNewTopic could have instead of (:input hidden target {$$topicpage} :)
this: (:input hidden target {$$(serialname)} :)
and in the - HansB Thanks! This works nicely. However, I have a few other difficulties getting the forum working smoothly. Maybe you have some ideas what might cause this:
There appears to be a bug on page FoxTemplates.FormTemplates section #newtopic:
Cheers, VG. (4-July-2008) When a new topic is created, then the topic does not automatically become the new subject. The first item on the comment page therefoe has no subject before it is edited. How can I make the topic to show up as a default subject? Replacing {{$$subject}} by {*$Namespaced} in the display template fixes it, but it that the idea? Latest release - JHJ I thik the best may be to edit the page FoxTemplates.FormTemplates section #newtopic, and replace (5-July-2008) Thanks! This works fine for my context now. However, in the main forum display I also changed [[{=$FullName}|'''{=$Titlespaced}''']] to [[{=$FullName}|'''{{=$FullName}$:subject001}''']] so that the changed subject is reflected in the forum topic. I needed this fix because when users enter a new topic, they sometimes make spelling and other mistakes. They then want to back and correct them. With these changes this is possible although the error still remains in the now invisible file name. JHJ, July 06 2008 (29-June-2008) Is it possible to enable preview for FoxForum so that I can preview my post before I submit it? - Daniel It is not possible at the moment. I will think about if it could be done. - HansB June 30, 2008, at 10:02 AM UPDATE: Now possible with latest release! - HansB July 03, 2008, at 05:55 AM Great! Thank you very much! - Daniel (17-June-2008) I am getting the following errors when I try to edit a test comment or an original topic entry: Warning: Wrong value for parameter 4 in call to preg_match_all() in /home/asterisk/html/cookbook/fox/fox.php on line 783
Warning: Wrong value for parameter 4 in call to preg_match_all() in /home/asterisk/html/cookbook/fox/fox.php on line 792
Fatal error: [] operator not supported for strings in /home/asterisk/html/cookbook/fox/fox.php on line 641 Has anyone run into anything like this before? Karl What version? Try the latest fox.phpΔ - HansB June 17, 2008, at 04:10 PM (14-May-2008) Hans, it seems TableEdit has the same problem as SectionEdit. Do you know of any way to fix this problem? Thank you very much, walter You are right. Both recipes manipulate the I added this code to my config.php:
$page = PageVar($pagename, '$FullName');
$group = PageVar($pagename, '$Group');
if($group!='Forum') {
include_once("$FarmD/cookbook/tabledit.php");
}
It works perfectly now. Thanks! walter (26-Feb-2008) Hi Hans, just found out that FoxForum got some problems with SectionEdit. Creating new topics works fine, but the site for a topic just comes up with some Variable-names ($$author, etc.) rather than their content. However, if I comment out sectionedit.php in my config file, all works fine. Besides that, enabling sectionedit and setting its configuration to "$SectionEditInIncludes = false;" again works, although the Author's name now shows up in '\"'. Thanks, Tobias My guess is that SectionEdit has a problem with the (07-Feb-2008) Is it possible to alternate the colors of the forum topics? I find that having alternating colors makes it much easier to read a forum. it is possible, but requires some modifications to a number of templates and the css. The basic idea would be this: when posting a comment the template which is used will insert an extra 0 or 1 after the $MarkupExpr['isodd'] = 'is_odd($args[0])';
function is_odd( $int ) {
return( $int & 1 );
}
and the change for the form template FoxTemplates.FormTemplates#comment is This solution is working, but I am not prepared to make the changes to the distributed forum, as it makes it even more complex. I hope you can do it yourself with these hints! HansB February 09, 2008, at 06:14 AM (21-Jan-2008) Hi Hans, I installed the standard version and it was working fine. There's a problem with creating new topic. Every new topic is named Forum.SpanSpanTopicpage regardless of the topic name. This causes a problem when I try to create another topic as it overwrites the first topic. I made no changes in the files or configuration. Edit: I guess there's some conflict with totalcounter package I installed. Disabling it makes the thing work again.
Thanks Max (20-December-2007) Hi Hans, I've just installed a standard version i.e. no forum name changes, using forum.forum etc. but with no captcha. New top and post all work fine but when I try to delete anything I get an Object Not Found 404 from trying to find "hxxp://usfosmesproj01/wiki//Forum.PilotProduct?action=foxdelete....." Note the double / after "wiki" i.e "...j01/wiki//Forum..." On all other pages with my Apache setup I see urls in the form "hxxp://usfosmesproj01/wiki/?n=Forum.PilotProduct" i.e. with the ?n=. Any suggestions? John Oakley you can either configure your wiki to use clean Urls (see CleanUrls) or edit fox.php in this way:
In the function FoxDeleteMarkup the line where it says (19-December-2007) Hi Hans, it seems to me that there is a numbering problem, if 2 users are reading and writing at the same time. Example:
Topic 1 has two comments => comment counter is 2 User A reads topic 1 User B reads topic 1 User A writes a comment => comment User A is stored with comment number 3 User B writes a comment => comment User B is stored with comment number 3 If someone reads this topic 4 comments are shown. The last 2 comments both have number 3 and both have the text of user B. The authors name is shown correct, but number and text are shown twice. In the source file it seems to me, that everything except the number is stored correct. But the number is doubled. I have tested it with the last version. NH Your analysis is correct. The count is taken from a page text variable FoxCount, and incremented, and this is used for the comment post. The value used is the one read when the page is loaded, so yes in can be out of date, and should be read when the post is processed. Not sure how to do this right now. I used to not use a page text variable as counter, but write a var directly as a page attribute. HansB December 19, 2007, at 01:03 PM Remedy: change in foxforum.php function FoxCountFilter to this: function FoxCountFilter($pagename, $fx) {
$fc = PageTextVar( $pagename, 'FoxCount');
$fx['FoxCount'] = sprintf("%03d",$fc+1);
return $fx;
} //}}}
(5-December-2007) Broken version?Is something broken in recent versions of Fox and FoxForum? I get the error ERROR: 'n' is not a legal field name. with FoxForum straight out of the box, and had the same problem when trying to set up a basic Fox and ToDo recipe. -- krisku I do not see any problem regards being broken. Make sure you use a (:fox formname ...:) markup, as it does not use the 'n' parameter. If you use a normal form: (:input form...:) and (:input hidden action foxpost:) and (:input hidden n {$FullName}:) you will get the error you describe. Yes and do not use 'n' as a field name! It is just a little security measure. The code regards to it has changed slightly, so I wonder if it is actually better now. Please let me know if you used 'n' as field name. code is on line 185 ca in fox.php. You could just comment it out there all else failing. HansB December 05, 2007, at 03:14 PM
(7-Dec-2007): I just found an explanation for the problem. I had set up my wiki to use the
CleanUrls recipe using URL rewriting and the RewriteRule turned the referenced page name into a ?n=$1 query string. When I reconfigured my Apache to use mod_alias instead, I got rid of the Oh thanks! This is a bug then! I accidentally introduced it with adding a new FoxRequestArgs function, which did merge input from $_POST and $_GET. I have limited this back to only use input from $_POST form submissions, and excluding the 'n' field name, till I am clearer about the security issues surrounding allowing input from url queries (i.e. php $_GET). Updates uploaded. HansB December 07, 2007, at 03:23 AM
(24-November-2007) Two shell scripts that you may find useful - dup.sh and upgrade.shThis section will only work for linux/unix users with access to the command line. Windows users could maybe develop a similar script as a .bat, BASIC or java file. Don't forget to make your scripts runnable: $ chmod a+x dup.sh dup.shThis script will make the changes needed to make another forum. It takes template files that you create and modifies them to make the new forum.
# use from the command line
# ./dup.sh NewForumName
target="XTemplate"
source="zTemplate"
if [ $1 = "" ] || [ $1 = ${source} ]
then
echo "No argument given or trying to copy the template file to itself"
exit 1
else
echo "Using $1"
cp ${source}.CreateNewTopic $1.CreateNewTopic
cp ${source}.Forum $1.Forum
cp ${source}.ForumConfig $1.ForumConfig
echo "Running sed on $1.php"
cat ${source}.php | sed "s/${target}/${1}/g" > ${1}.php
fi
Before you use it you need to do some setup. You only need to do these steps once:Setup Step 1: Copy these files, rename them, and put them into the same folder with the dup.sh script:
Setup Step 2: Modify this line in zTemplate.php$FoxPagePermissions['Forum.*'] = 'all';
$FoxPagePermissions['XTemplate.*'] = 'all';
Note: Case does matter!!
Now you are ready to make a new forumStep 1: Run the dup.sh script and pass it the name of the new forum name. For example: ChessForum
$FoxPagePermissions['ChessForum.*'] = 'all'; Step 2: Move the files to the correct folders
In this example:
Step 3: Add a link to the forum to a wiki page.In this example something like: Thats it! Now to make another forum you can simply:
(24-November-2007) upgrade.shThis script will help make the changes to upgrade foxforum from the pre 2007-10-22 releases to the post 2007-10-22 releases. This script uses the steps listed in the "Upgrade Note" in the "Release Notes" section of the Cookbook.FoxForum page.
# use from the command line
# ./upgrade.sh FileName
t1='{ForumConfig$:DisplayTopicTemplate}'
r1='{$DisplayTopicTemplate}'
t2='{ForumConfig$:DisplayCommentTemplate}'
r2='{$DisplayCommentTemplate}'
t3='text=$:comment'
r3='subject={$FullName}$:subject000 text={$FullName}$:comment'
if [ $1 = "" ]; then
echo "No argument given"
exit 1
else
cp ${1} ${1}.old
echo "Upgrade file $1"
cat $1 | sed "s/$t1/${r1}/g" > ${1}.test
cat ${1}.test | sed "s/$t2/${r2}/g" > ${1}.test
cat ${1}.test | sed "s/$t3/${r3}/g" > ${1}.test
rm ${1}
mv ${1}.test ${1}
fi
The script looks in the forum.topic file for three target strings (t1, t2, and t3) and replaces them with three replacement strings (r1, r2, and r3) respectively. Pass it the name of the forum you want to upgrade. An example would be upgrading your old ChessForum.Forum. Imagine that someone had posted a discussion about opening moves: ChessForum.Openers To run the upgrade script you would type:
Note:
(19-August-2007) I got ForumX working nicely, but the topic display always returns one non-existing topic at the very bottom of the page. It looks like this: Have you enclosed the forum pagelist template in a >>comment<< division? - HansB
Yes, but it appears that the current release of ForumX is incompatible with the cookbook script AdvancedTableDirectives.php. Removing this script fixed the problem. JHJ, August 26
(16-July-2007) I want to usecreate the Index Page to show all existing Topics but I can't find any hinstruction how to create the mentioned Index Page. please help Leftaf? There is a Forum.Forum and a ForumX.ForumX index page included in the zip in foxforum/wikilib.d. Copy the relevant pagelist markup plus template if you need it on a different page. HansB July 18, 2007, at 11:45 AM
(29-June-2007) If you configure the forum for 20 posts per page - what happens to post #21? ~Matt It will show on page 2. Links to all pages are shown on all pages. HansB July 18, 2007, at 11:45 AM
(25-June-2007) We're getting hit by the spambots but so far the "number verification" is holding up. Unfortunately, even if the poster doesn't enter the correct number, the thread's "last posted by" is shown as the poster's name and the datestamp (hence ordering) is revised. Is there any way we can prevent this? -- JLuk I think this could be caused by the foxptvreplace filter function. You may try this untested modification of foxptvreplace.php: add inside the function FoxPTVReplace before the line starting with FoxPagePermissionCheck:
FoxSecurityCheck($pagename, $fields);
This should run all security checks including access code check before the main ptv replacing, thereby aborting the operation if an error occurs, instead of doing the ptvreplace bit, and aborting later. If this works I should add it to the code in the distribution. HansB July 18, 2007, at 11:45 AM
(12-June-2007) Tip: make sure you don't have an anchor named #forum on your page, because that is also the name of the default pagelist format style!! Took me hours to figure out why my page wasn't displaying! Also, a few bug reports:
(9-June-2007) (Bug report deleted as it was fixed in the latest version. If you're curious, see the History. Thanks, HansB! We are now running a site for 400-member alumni association using your FoxForum.) -- JLuk Hallo!
Above is spoken about pub/ files but foxforum.zip contains only local and cookbook directories? Did you copy local/Forum.php to your local/ directory? local/Forum.php contains the local customisations for the forum, for group Forum, including the $FoxPagePermission setting. If you use a different group, you need to rename the file and change this setting. - The referenc eto the pub/ folder was outdated, sorry! I removed it now. HansB May 17, 2007, at 02:50 PM |