Hallo Forum,
In hatte ich »versprochen«, mich mal an die Arbeit zu machen, die FAQ-Links-Anzeige zu implementieren.
Ich habe das ganze jetzt mal in meine lokale Testinstallation eingebaut. Angefügt habe ich einen Patch für die aktuellen Forumssources aus dem CVS. Für das Forum hier werden nicht die aktuellen verwendet, leider weiß ich auch nicht, welche Version ganz genau. Ich bin jedoch der Ansicht, dass die Teile, die ich jetzt bearbeitet habe, sich nicht von den aktuell verwendeten unterscheiden. Ganz genau kann das aber nur CK wissen.
Das ganze funktioniert so: In der fo_view.conf gibt es im Abschintt <ForumBehavior> eine neue Option, nämlich ShowFAQLinks. Diese Option sollte der Administrator auf "yes" stellen. In der Benutzerkonfiguration kann jeder Benutzer diese Hinweise wahlweise an oder aus stellen. Es taucht über dem Submit-Button unter der Vorschau-Generieren-Checkbox eine Zeile auf, die im Moment den Text "FAQ-Links" enthält. Dies sollte man jedoch noch personalisieren, denn FAQ-Links ist nicht gerade aussagekräftig. Die Dateien heißen forum_posting.html und thread.html. (sie sind zwei mal vorhanden, einmal im html4-Template-Verzeichnis und einmal im xhtml10-Template-Verzeichnis)
Zur Installation: Theoretisch (ich übernehme KEINE Haftung!) müsste man nichts anderes als das Verzeichnis, in dem das SELFForum kompiliert wurde (das existiert ja hoffentlich noch?) patchen. Danach ein make modules templates drüber laufen lassen. Daraufhin muss die Datei .lib/modules/flt_posting.so über die andere flt_posting.so drüberkopiert werden, die sich im Installationsverzeichnis des SELFForums befindet. Die Dateien .lib/templates/tpl_html4/forum_posting.so und .lib/templates/tpl_xhtml10/forum_posting.so müssen dann in die jeweiligen Unterverzeichnisse des ctemplates-Verzeichnisses. Schließlich müssen noch die thread.html-Template-Dateien in ihre jeweiligen Verzeichnisse der Installation kopiert werden. cgi-shared/Plugins/Variables.pm muss natürlich auch noch kopiert werden. Danach müßten die Änderungen sofort aktiv werden. Aber wie gesagt: Ich garantiere für NICHTS, zumal ich keine Ahnung von der exakten verwendeten Version des SELFForums und von der Installation auf dem SELF-Server habe.
Christian
Index: cgi-shared/Plugins/Variables.pm
RCS file: /home/users/cvs/selfforum/cgi-shared/Plugins/Variables.pm,v retrieving revision 1.5 diff -u -r1.5 Variables.pm --- cgi-shared/Plugins/Variables.pm 25 Nov 2002 18:09:34 -0000 1.5 +++ cgi-shared/Plugins/Variables.pm 25 Jan 2003 11:26:45 -0000 @@ -72,6 +72,19 @@ $tpl->setVar('ImageUrl',$user_config->{ImageUrl}->[0]->[0]) if exists $user_config->{ImageUrl} && !defined $cgi->param('ImageUrl'); $tpl->setVar('HomepageUrl',$user_config->{HomepageUrl}->[0]->[0]) if exists $user_config->{HomepageUrl} && !defined $cgi->param('HomepageUrl');
+ if (exists $user_config->{ShowFAQLinks}) { + if ($user_config->{ShowFAQLinks}->[0]->[0] eq "yes") { + $tpl->setVar('showfaqlinks','1'); + } + } + else { + if (exists $fo_view_conf->{ShowFAQLinks}) { + if ($fo_view_conf->{ShowFAQLinks}->[0]->[0] eq "yes") { + $tpl->setVar('showfaqlinks','1'); + } + } + } + if($user_config->{TextBox}) { $tpl->setVar('twidth',$user_config->{TextBox}->[0]->[0]) if $user_config->{TextBox}->[0]->[0]; $tpl->setVar('theight',$user_config->{TextBox}->[0]->[1]) if $user_config->{TextBox}->[0]->[1]; Index: cgi-shared/config/templates/tpl_html4/forum_posting.html
RCS file: /home/users/cvs/selfforum/cgi-shared/config/templates/tpl_html4/forum_posting.html,v retrieving revision 1.34 diff -u -r1.34 forum_posting.html --- cgi-shared/config/templates/tpl_html4/forum_posting.html 27 Nov 2002 14:50:21 -0000 1.34 +++ cgi-shared/config/templates/tpl_html4/forum_posting.html 25 Jan 2003 11:26:46 -0000 @@ -104,6 +104,9 @@ <td align="right" valign="middle"><b>Vorschau generieren</b></td> <td valign="top"><input type="checkbox" name="preview" value="1"{if $preview} checked{endif}></td> </tr>{endif} +{if $showfaqlinks} <tr> + <td colspan="2">FAQ-Links</td> + </tr>{endif} <tr><td valign="top" nowrap colspan="2"><input type="submit" value="Nachricht absenden">{if $previewswitchtype == "button"} <input type="submit" name="preview" value="Vorschau generieren">{endif}</td></tr> </table> </form><br> Index: cgi-shared/config/templates/tpl_html4/thread.html
RCS file: /home/users/cvs/selfforum/cgi-shared/config/templates/tpl_html4/thread.html,v retrieving revision 1.9 diff -u -r1.9 thread.html --- cgi-shared/config/templates/tpl_html4/thread.html 19 Nov 2002 15:24:03 -0000 1.9 +++ cgi-shared/config/templates/tpl_html4/thread.html 25 Jan 2003 11:26:46 -0000 @@ -96,6 +96,9 @@ <td align="right" valign="middle"><b>Vorschau generieren</b></td> <td valign="top"><input type="checkbox" name="preview" value="1" <$ if $preview then $>checked<$ endif; $>></td> </tr><$ endif; $> +<$ if $showfaqlinks then $> <tr> + <td colspan="2">FAQ-Links</td> + </tr><$ endif; $> <tr><td valign="top" nowrap colspan="2"><input type="submit" value="Nachricht absenden"><$ if $previewswitchtype == "button" then $> <input type="submit" name="preview" value="Vorschau generieren"><$ endif; $></td></tr> </table> </form><br> Index: cgi-shared/config/templates/tpl_xhtml10/forum_posting.html
RCS file: /home/users/cvs/selfforum/cgi-shared/config/templates/tpl_xhtml10/forum_posting.html,v retrieving revision 1.2 diff -u -r1.2 forum_posting.html --- cgi-shared/config/templates/tpl_xhtml10/forum_posting.html 19 Nov 2002 20:34:09 -0000 1.2 +++ cgi-shared/config/templates/tpl_xhtml10/forum_posting.html 25 Jan 2003 11:26:47 -0000 @@ -139,6 +139,9 @@ <td class="descr"><b>Vorschau generieren</b></td> <td class="field"><input type="checkbox" name="preview" value="1"{if $preview} checked="yes"{endif}/></td> </tr>{endif} +{if $showfaqlinks} <tr> + <td class="field" colspan="2">FAQ-Links</td> + </tr>{endif} <tr> <td class="field" colspan="2"><input type="submit" value="Nachricht absenden"/>{if $previewswitchtype == "button"} <input type="submit" name="preview" value="Vorschau generieren"/>{endif}</td> </tr> Index: cgi-shared/config/templates/tpl_xhtml10/thread.html
RCS file: /home/users/cvs/selfforum/cgi-shared/config/templates/tpl_xhtml10/thread.html,v retrieving revision 1.1 diff -u -r1.1 thread.html --- cgi-shared/config/templates/tpl_xhtml10/thread.html 19 Nov 2002 17:11:21 -0000 1.1 +++ cgi-shared/config/templates/tpl_xhtml10/thread.html 25 Jan 2003 11:26:47 -0000 @@ -96,6 +96,9 @@ <td align="right" valign="middle"><b>Vorschau generieren</b></td> <td valign="top"><input type="checkbox" name="preview" value="1" <$ if $preview then $>checked<$ endif; $>></td> </tr><$ endif; $> +<$ if $showfaqlinks then $> <tr> + <td colspan="2">FAQ-Links</td> + </tr><$ endif; $> <tr><td valign="top" nowrap colspan="2"><input type="submit" value="Nachricht absenden"><$ if $previewswitchtype == "button" then $> <input type="submit" name="preview" value="Vorschau generieren"><$ endif; $></td></tr> </table> </form><br> Index: src/modules/flt_posting.c
RCS file: /home/users/cvs/selfforum/src/modules/flt_posting.c,v retrieving revision 1.43 diff -u -r1.43 flt_posting.c --- src/modules/flt_posting.c 3 Dec 2002 23:41:52 -0000 1.43 +++ src/modules/flt_posting.c 25 Jan 2003 11:26:50 -0000 @@ -156,7 +156,8 @@ char *ActiveColorB; int Preview; int PreviewSwitchType; -} Cfg = { 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0 }; + int ShowFAQLinks; +} Cfg = { 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 };
t_message *get_parent_message(t_message *msgs,t_message *tmsg) { t_message *msg,*bmsg = NULL; @@ -252,6 +253,10 @@ else if(Cfg.PreviewSwitchType == 1) { tpl_cf_setvar(tpl,"previewswitchtype","button",6); } + + if (Cfg.ShowFAQLinks) { + tpl_cf_setvar(tpl,"showfaqlinks","1",1); + }
if(Cfg.ActiveColorF && *Cfg.ActiveColorF) { tpl_cf_setvar(tpl,"activecolorf",Cfg.ActiveColorF,strlen(Cfg.ActiveColorF)); @@ -686,6 +691,13 @@ return 0; }
+int handle_faqlinks(t_configfile *cfile,t_conf_opt *opt,const char *arg1,const char *arg2,const char *arg3) { + Cfg.ShowFAQLinks = strcmp(arg1,"yes") == 0; + + return 0; +} + + int handle_prevt(t_configfile *cfile,t_conf_opt *opt,const char *arg1,const char *arg2,const char *arg3) { if(strcmp(arg1,"button") == 0) { Cfg.PreviewSwitchType = 1; @@ -734,6 +746,7 @@ { "TextBox", TAKE2, { ARG_STR, ARG_STR, ARG_NONE }, handle_box, NULL }, { "GeneratePreview", TAKE1, { ARG_YESNO, ARG_NONE, ARG_NONE }, handle_prev, NULL }, { "PreviewSwitchType", TAKE1, { ARG_STR, ARG_NONE, ARG_NONE }, handle_prevt, NULL }, + { "ShowFAQLinks", TAKE1, { ARG_STR, ARG_NONE, ARG_NONE }, handle_faqlinks, NULL }, { "ActivePostingColor", TAKE2, { ARG_STR, ARG_STR, ARG_NONE }, handle_actpcol, NULL }, { NULL } }; Index: cgi-shared/config/modconf/modules.xml
RCS file: /home/users/cvs/selfforum/cgi-shared/config/modconf/modules.xml,v retrieving revision 1.33 diff -u -r1.33 modules.xml --- cgi-shared/config/modconf/modules.xml 26 Nov 2002 04:11:34 -0000 1.33 +++ cgi-shared/config/modconf/modules.xml 25 Jan 2003 11:30:59 -0000 @@ -96,6 +96,17 @@ </formvalues> </argument> </directive> + <directive name="ShowFAQLinks" arguments="1"> + <argument paramname="showfaqlinks" type="radio"> + <validate>^(?:yes|no)$</validate> + <question>Möchten Sie neben dem Submit-Button für Postings Links auf die FAQ angezeigt haben?</question> + <error>Bitte geben Sie 'ja' oder 'nein' an!</error> + <formvalues> + <value val="yes">Ja</value> + <value val="no" default="yes">Nein</value> + </formvalues> + </argument> + </directive> </module>
<module name="flt_posting">