Firefox PHP

Search Most Followed Topics Module (5.1 and 5.2 ready)

All files from this thread

File Name File Size   Posted by Date  
search_most_followed-1.0.0.zip 13.9 KB open | download Oliver Riesen-Mallmann 09/07/2006 Read message
Search Most Followed Topics Module (5.1 and 5.2 ready)
September 07, 2006 11:35AM
Search Most Followed Topics Module (5.1 and 5.2 ready)

Adds search for most followed topics.

Tested on version 5.1.16 and CVS (till revision 1334) for MySQL. DB-layer for mysqli and postgresql included but not tested. Please give me a feedback if this parts are working for you.

License:

Free to use, modify, or redistribute this code so long as I am given credit for the original development somewhere. This code comes with absolutly no warranty.

Installation:

1. Unpack the archive.

2. Move the directory "search_most_followed" to the directory "mods" within your Phorum installation. Don't change the directory name!

3. Move search-most-followed.php to your phorum-directory. Rename the file if you want to use a localised file name (in this case you have to change the file name also in the settings).

4. Move search-most-followed.tpl, search-most-followed-form.tpl and search-most-followed-form-header.tpl to your template-directory.

5. To show a link to the most followed topic page on the list page, edit list.tpl and list_threads.tpl. Add the following code just behind the •{INCLUDE "loginout_menu"}:

{IF URL->SEARCH_MOST_FOLLOWED}&bull;<a class="PhorumNavLink" href="{URL->SEARCH_MOST_FOLLOWED}">{LANG->SEARCH_MOST_FOLLOWED}</a>{/IF}

6. To show a search form, edit search.tpl. Add the following lines just before the last </table>:

6a. If you're using only the Search Most Followed Topics Module:

  <tr>
    <td>&nbsp;</td>
    <td style="width: 10px">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td class="PhorumStdBlockHeader PhorumNarrowBlock" style="text-align: left;">{INCLUDE "search-most-followed-form-header"}</td>
    <td style="width: 10px">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td class="PhorumStdBlock PhorumNarrowBlock" style="padding: 10px;">
      {INCLUDE "search-most-followed-form"}
    </td>
    <td style="width: 10px">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>

6b. If you're using the Search Most Followed Topics and Search Most Read
Modules together:

  <tr>
    <td>&nbsp;</td>
    <td style="width: 10px">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td class="PhorumStdBlockHeader PhorumNarrowBlock" style="text-align: left;">{INCLUDE "search-most-read-form-header"}</td>
    <td style="width: 10px">&nbsp;</td>
    <td class="PhorumStdBlockHeader PhorumNarrowBlock" style="text-align: left;">{INCLUDE "search-most-followed-form-header"}</td>
  </tr>
  <tr>
    <td class="PhorumStdBlock PhorumNarrowBlock" style="padding: 10px;">
      {INCLUDE "search-most-read-form"}
    </td>
    <td style="width: 10px">&nbsp;</td>
    <td class="PhorumStdBlock PhorumNarrowBlock" style="padding: 10px;">
      {INCLUDE "search-most-followed-form"}
    </td>
  </tr>

7. Login as administrator in Phorum's administrative interface and go to the "Modules" section.

8. Enable the module "Search Most Followed Topics Module".

Language support:

This module supports multiple languages.

The following languages are included:

- Englisch
- German (Sie)
- German (Du) male
- German (Du) female

If you want to translate the module to a new language, you'll have to do the following:

Copy lang/english.php to lang/yourlang.php (yourlang.php must have the same name as Phorum's main language file that you use). After this, translate the strings in lang/yourlang.php.

If you have created a translation for this module, please post a zip file containing lang/yourlang.php in the module thread at phorum.org, so the translation can be added to the module package.

Sanity Checks:

If you have problems with this module login as administrator in Phorum's administrative interface and go to the "System Sanity Checks" section. Check for warnings or errors for the Search Most Followed Topics Module.

Changelog:

2006/09/07 version 1.0.0 Initial version by Oliver Riesen (oliver@riesen.org)


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.




Edited 1 time(s). Last edit at 09/07/2006 11:37AM by Oliver Riesen.
Attachments:
open | download - search_most_followed-1.0.0.zip (13.9 KB)
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 07, 2006 11:58AM
Oliver,
you are providing a lot of search-(whatever)-mods ;) ...
how about putting them in one mod?

Also I think these parts
3. Move search-most-followed.php to your phorum-directory. Rename the file if you want to use a localised file name (in this case you have to change the file name also in the settings).

4. Move search-most-followed.tpl, search-most-followed-form.tpl and search-most-followed-form-header.tpl to your template-directory.

can now be avoided using addon.php and the mod-templates which were just added in 5.1.16.


Thomas Seifert
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 07, 2006 03:26PM
Hi Thomas,

Quote
ts77
you are providing a lot of search-(whatever)-mods ;) ...

I have to do so. All this searches exists already in our extended version 3.3.2c... I can't switch with our forum to 5.1 (or 5.2) before I can offer at least the same functions...

And one search-mod is still missing ;-)

Quote
ts77
how about putting them in one mod?

Sometimes it's for me easier to do things in small steps. So first I'll build individuell modules for each search. Next step is to put all search modules in one package to make the installation more easier and to offer a better integration in the navigation bar (for example with a separate navigation bar) but each module is still apart. Later I'll offer an integration in the phorum core ;-) But before I have to switch out forum to a new version...

And since I better myself with each new module I try to update also older modules to my new level; actually with the sanity checks and auto-installation of module default settings.

And there are already some new ideas. In my opinion the phorum core should contain the necessary functions for the module sanity checks. Also the example module could be improved to show more aspects of module programming (auto-installation of custom profile field and module default settings; sanity checks; usage of addon-script with arguments).

Quote
ts77
Also I think these parts
3. Move search-most-followed.php to your phorum-directory. Rename the file if you want to use a localised file name (in this case you have to change the file name also in the settings).

4. Move search-most-followed.tpl, search-most-followed-form.tpl and search-most-followed-form-header.tpl to your template-directory.

can now be avoided using addon.php and the mod-templates which were just added in 5.1.16.

I'm observing Maurice efforts in this area but I'm not already convinced.

I try to develop all my modules for the actual stable version (5.1) AND for the next release 5.2. Since there are a lot of differences in the template variables I have to offer in same cases different templates. The new feature from Maurice doesn't help in this case...

In one of my next versions for the search-*-mods I'll implement also the addon-script feature. But I'm still thinking about this feature because the addon-URL is less usefull for search engines. For the moment I prefer to offer these feature like an option so that webmasters can decide if they want an easy installation or a better ranking.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 07, 2006 04:36PM
Quote

Since there are a lot of differences in the template variables I have to offer in same cases different templates. The new feature from Maurice doesn't help in this case...

There will probably be a lot more changes in Phorum 5.2, which will possibly make building both 5.1 and 5.2 compatible modules harder and harder (sneak preview: all the hook names might change to provide consitent and clear names instead of the more or less random names that were assigned up to now).

Personally, I do not want to jump hoops to serve multiple Phorum versions from one single module. If differences get too large, then I will go for separate releases of a module for each system. In the end, that will keep the modules clean from all kind of constructions for making the modules backward compatible. It also decreases the risk of not being fully compatible for one of the versions (like you already ran into with {USER} and {USERINFO}). One last plus for building a module for a specific Phorum release, is that the module could be smaller (especially for newer releases of Phorum, certain functionality might be available in the core already, which makes dubbing that code for that functionality in your own module redundant).

So what I will not work on, is providing a framework for building modules that can span multiple Phorum versions. My filosophy is that it's better to have modules keep pace with a single version of Phorum.

I think your main problem currently is that you are developing modules for your system, which is running the Phorum 5.2 development tree, but that you still want to release the modules that you wrote there for the 5.1 users. I know that this is not an easy situation to cope with (I am also writing my modules for both systems), but it's a choice that you have made.

Quote

In my opinion the phorum core should contain the necessary functions for the module sanity checks.[..] auto-installation of custom profile field and module default settings

For these kind of things, I want to provide a library which is tailored for module writing. This library can contain these and other module "building blocks". For creating custom profile fields, I even think there should be core API functions, used by Phorum itself too. For things like default settings and initialization tasks, we have an idea to provide an activate and deactivate hook, which will be called at appropriate times from the admin interface. That way, you do not have to keep track of things yourself, but you can simply plug into the module activate hook.

I agree that more documentation is always good for module writers (and trust me, there will be a lot of documentation for 5.2), but some things have to be solved in a more structural way, without putting the burden on the module writers.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 08, 2006 02:27AM
Hi Maurice,

Quote
mmakaay
I think your main problem currently is that you are developing modules for your system, which is running the Phorum 5.2 development tree, but that you still want to release the modules that you wrote there for the 5.1 users. I know that this is not an easy situation to cope with (I am also writing my modules for both systems), but it's a choice that you have made.

I think I did my choice already ;-)

It's the third time that I try to switch to an actual Phorum version. Switch to 3.4 stumbled over the changed cookie handling which wasn't compatibel with some of our own extensions. Some weeks of work with an early version of 5.0 showed that this version didn't contain at least all functionality from Phorum3.

Now, in my third try, I'm pressured to succeed. We startet six monthes before and there are still some tasks to do before I can switch. And even version 5.1 is still missing some functions which the Phorum3 offered.

So I decided, that if I have to invest monthes of work in this switch, I don't want to switch to the latest stable release but rather to the latest development release. For me it seems very probably that I'll end with my switch just before the first stable release of 5.2. I would be very annoyed if I switch to a stable 5.1 and some days later you publish a first stable version of 5.2 ;-)

But imagen what happens if I make all my modules only for the developement tree and some other module programmers write 5.1 modules with same functionalty. Double work, a lot of confusion for Phorum starters, etc.

Currently it's already complicated for a Phorum starter to get familiar with the usage of modules. The list of modules seems incomplete, a lot of modules a abandoned, some works only with 5.0, some are written in a poor quality.

So I try to offer at least for my own modules: compatibility with stable and development tree, advanced handling of installation, self-diagnostic, best language support, maximum documentation and quality program code.

Quote
mmakaay
Quote

In my opinion the phorum core should contain the necessary functions for the module sanity checks.[..] auto-installation of custom profile field and module default settings

For these kind of things, I want to provide a library which is tailored for module writing.

I'll be happy to contribute some functions to this library. But first let me switch my forum :-))

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 08, 2006 11:09AM
Hi Thomas, Hi Maurice,

Quote
ts77
can now be avoided using addon.php and the mod-templates which were just added in 5.1.16.

I played with one of my search modules to get firm using addon.php and mod-templates. I can avoid SOME of the installation tasks but not ALL off them. The webmaster still has to make some changes to template files, for example in my case to show a link in the navigation bar and to integrate the additional search form.

So I'm still not completely convinced to use addon.php and mod-templates since it's not yet possible (in case of my search modules) to offer a "just upload and enable" module. But if the webmaster has to do some file modifications he can do also all of them.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 08, 2006 11:29AM
It's your module, so I cannot tell you what to do, but IMO it's best to let a webmaster do as little as possible for upgrading and installing. The changes that the webmaster has to make are possibly only needed at install time. For upgrading, I bet that most changes go in the addon script and the template files and those can be contained in the module now.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 08, 2006 04:54PM
Hi Maurice,

Quote
mmakaay
but IMO it's best to let a webmaster do as little as possible for upgrading and installing. The changes that the webmaster has to make are possibly only needed at install time. For upgrading, I bet that most changes go in the addon script and the template files and those can be contained in the module now.

Okay, okay... ;-) I tried it first with my Search Hot Topics Module.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 08, 2006 05:54PM
Cool ;-)


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Search Most Followed Topics Module (5.1 and 5.2 ready)
September 09, 2006 02:00AM
Hi Maurice,

Quote
mmakaay
Cool ;-)

Please have a look before a start to change also my other Search-* Modules. Comments are welcome.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Sorry, only registered users may post in this forum.

Click here to login