[ABD] Medal System MOD for phpBB3

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan
Contact:

[ABD] Medal System MOD for phpBB3

Postby Gremlinn » Wed Sep 26, 2007 5:50 pm

MOD Title: Medal System MOD for phpBB3
MOD Description: A system for awarding medals/ribbons to users.
MOD Version: 0.11.0

MOD Download: Medal System MOD for phpBB3
Last Stable version: None at this time

Demo Board: http://test.dupra.net
Demo Username: n/a
Demo Password: n/a

Credits:
ycl6: For creating the original system for phpBB2. And giving me the go ahead to do the conversion.
geoffreak: For getting a great start on writing the Medal System 0.2.0, for which I continue his work here.

Current Features
  • Admin Control Panel
  • Medal Control Panel - per user
  • User-User Nominations
  • Profile Display
  • Topic display
  • Medal reason/date displayed
  • Dynamic multiple images
  • Global Medal Control Panel
  • Self installing/upgrading DB
  • Awarded medals earn points (integrate for Simple Points Mod)
  • ACP
  • UCP
  • prosilver template
  • subsilver2 template
  • Medals can be nominated more than once
  • Nominated medals can be edited before awarded
  • Multiple Nominations
  • Nominations Control Panel
  • MOD Version Check compliant
  • Activation/Deactivation switch
  • automod compatible
  • UMIL database install
In the Works:
  • Testing is currently underway
In the Future
  • Awarded medals earn cash (integrate for Cash Mod)

Note: I did not integrate Cash Mod as the only thing I did to get Simple Points Mod "integrated" was to require 'points_enable' be set to 1 in the config table and user_points field be defined in the users table for every user. Anyone can change that to work with cash mod quite simply by changing the medals.php file.

Upgrade: There is now upgrade install instructions in the upgrade folder.

Unsupported: Conversion from Medal System Mod 0.4.6 for phpbb2 :: "converter"
Also provided is a reference in the extras folder to the Database updates. This is NOT meant to be run, but provided to show you what the SQL changes are. DO NOT run this as it may not do all the SQL setup. The statements provided are the edits that I have created.

User Contributed:
Put medals under a user's signature

FYI: If you are unfamiliar with installing mods, please read the following posts before continuing.
MODX Instructions How-to
SQL Update How-to (should not be needed for this mod, but is good to understand.
Last edited by Gremlinn on Tue Nov 24, 2009 1:26 pm, edited 47 times in total.
.:: Medal System MOD for phpBB3 :: Country Flag User Edition :: Roster Mod ::.

Please no PM Support questions.
My phpmod site: http://test.dupra.net/

User avatar
oddfish
Registered User
Posts: 839
Joined: Mon Mar 19, 2007 8:45 pm
Location: Testing 3.1
Contact:

Re: [Alpha] Medal System MOD for phpBB3

Postby oddfish » Wed Sep 26, 2007 11:34 pm

my thanks Gremlinn.

Have setup as per the instructions, NOTE: Open: languages/en/acp/common.php should be Open: language/... and the prosilver template xml shows Open: styles/prosilver/viewtopic_body.html instead of Open: styles/prosilver/templates/viewtopic_body.html.

Have created the medal folder with images, setup a Category and Medals. Cleared cache etc but can't access the Medal Control Panel. Says "You dont have the necessary permissions to access this page."

No medal info displayed in the viewtopic page and 2 Medals entries in the .MODS tab (ACP next to system) - perhaps from a previous install months ago which was removed prior to installing this update.

Will check back with a clean install.
Country Flag User Edition Clickable Post Count Link

... another record broken without breaking any records ...
Testing phpBB3.1 dark style based on prosilver ... http://www.oddmods.net

User avatar
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [Alpha] Medal System MOD for phpBB3

Postby RedTrinity » Thu Sep 27, 2007 1:37 am

Ok I completely uninstalled the previous version and just installed this updated one, but am unfortunately having the same problems as before :( Whilst I am having no problems awarding medals to users, its the displaying of them afterwards that is causing the most issues.

This is what they are:

1. Menu option does not appear properly in profiles (see screenshot below)
Image

2. Medal display area does not appear in profiles at all - if I force it to appear by removing the switches, this is what it appears like (even after awarding a medal to the user):
Image

However the 'Medals: 1' field IS appearing in viewtopic now, which is wasn't previously - although it does not appear to be linking to anything, its just a display like the posts, joined, location etc. fields. So not sure if its intended to be this way or if its related to the problems above.

It seems that there may be some language edits missing but I have checked through edits many times over and can't seem to locate any further install files within the MOD package - though it does say the following at the end of the default install file:

Make sure you clear your board cache to show all the changes this mod makes!
And don\'t forget to open the templates and language directories to install style and language edits!


The language directory only leads to 1 file to upload, however? So it appears that there may be a language edit install file missing that should have been there...

Would really appreciate any assistance with these problems as this is what has been holding me back from using this MOD for the last 2 or so months :D

And thanks again for taking it over, I am sure many are very grateful!!! We have been hanging to use it ;)

User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan
Contact:

Re: [Alpha] Medal System MOD for phpBB3

Postby Gremlinn » Thu Sep 27, 2007 11:57 am

Here is a small explanation of what I have done so for the initial release.

I extracted the 0.2.1 version, edited two pieces of code, made some document notes and re-zipped it. If it worked with 0.2.1, then it should still work with this one. I followed the edits to the letter (I used copy and past for the find options and they always brought me to the correct lines).

Now, that I have said that, There is only one languages file. There are a couple edits for the admin language file common.php. I hate to say it but, you'll have to check your edits ;)

oddfish: I will correct the install instructions as noted. I saw those when I installed it and forgot when I got around to re-packaging it. Thank you. I'll have to get back to you about the permission issue. As I have said, I only just took this over and never saw the code before yesterday :shock:
.:: Medal System MOD for phpBB3 :: Country Flag User Edition :: Roster Mod ::.

Please no PM Support questions.
My phpmod site: http://test.dupra.net/

User avatar
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [Alpha] Medal System MOD for phpBB3

Postby RedTrinity » Thu Sep 27, 2007 12:19 pm

Gremlinn wrote:Here is a small explanation of what I have done so for the initial release.

I extracted the 0.2.1 version, edited two pieces of code, made some document notes and re-zipped it. If it worked with 0.2.1, then it should still work with this one. I followed the edits to the letter (I used copy and past for the find options and they always brought me to the correct lines).

Now, that I have said that, There is only one languages file. There are a couple edits for the admin language file common.php. I hate to say it but, you'll have to check your edits ;)


I have just checked them and they are definately all there - I get the same result every time I re-install this MOD and I have tried it about 3 times now :(

You may also notice that a couple of other members in the previous thread by Geoffreak also were experiencing the same problems as I am experiencing now, so I was under the impression that either his code is flawed somewhere or we are all overlooking something really important somewhere!

But I have looked this over many times now in desperation and can't seem to work out whats wrong.

User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan
Contact:

Re: [Alpha] Medal System MOD for phpBB3

Postby Gremlinn » Thu Sep 27, 2007 12:58 pm

I am going to be re-installing again to go over the install to get accurate documentation for sure. I'll let you know when I get there. I might have just inserted some code where it need to go without reading the install closely :?
.:: Medal System MOD for phpBB3 :: Country Flag User Edition :: Roster Mod ::.

Please no PM Support questions.
My phpmod site: http://test.dupra.net/

User avatar
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [Alpha] Medal System MOD for phpBB3

Postby RedTrinity » Thu Sep 27, 2007 1:29 pm

Ok I just managed to fix the problem with this problem:

Image

The following code was part of medals.php within the language/eng/mods folder:

'MEDAL_CP' => 'Medals Control Panel',


I added this line to language/eng/common.php and now its displaying properly as 'Medals Control Panel' link in profiles.

So not sure what the go is there, whether its just my forum not wanting to read the medals language file from the /mods folder or whether they are in the wrong spot to start with? Though all the english is working from that file within my ACP and what not, just seems to be profiles which are dodgy atm!

Hope that info helps identify the problem somehow if not confuse you any further lol.

Edited to add: Just fixed the other screenshot problem as well with the text not displaying properly, did the same as above. The final product was the following 3 lines added to the normal edit for language/eng/common.php:

$lang = array_merge($lang, array(
'ACP_MEDALS_INDEX' => 'Medals ACP',
'ACP_MEDALS_TITLE' => 'Medals Management',
'ACP_MEDALS_SETTINGS' => 'Configuration',
'acl_u_award_medals' => array('lang' => 'Can award medals to users', 'cat' => 'misc'),
'acl_a_manage_medals' => array('lang' => 'Can use the medals management module', 'cat' => 'misc'),
'MY_MEDALS' => 'My Medals',
'MEDAL_CP' => 'Medals Control Panel',
'NOMINATE' => 'Nominate Medal',
));


So now all text for medals is displaying correctly in profiles!

Now to just work out why the awarded medals section won't display in profiles...

User avatar
.:: Chico ::.
Registered User
Posts: 463
Joined: Fri Aug 03, 2007 6:35 am
Location: Rio de Janeiro
Contact:

Re: [Alpha] Medal System MOD for phpBB3

Postby .:: Chico ::. » Thu Sep 27, 2007 2:10 pm

geoffreak: For getting a great start on writing the Medal System 0.2.0, for which I continue his work here.


Maybe you could continue geofreak thanked post mod.. :?

Do you know what happened with him?

User avatar
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [Alpha] Medal System MOD for phpBB3

Postby RedTrinity » Thu Sep 27, 2007 3:06 pm

.:: Chico ::. wrote:Do you know what happened with him?


Gremlin is simply continuing on where Geoffreak left off with the Medal MOD due to the demand for it - going by the post he left addressed to GF in the other Medal MOD thread I would assume he hasn't had any contact with the original author let alone know what happened to him.

But hopefully Geoffreak is doing alright, out there wherever he has disappeared to!

On another note I am very relieved and pleased to say I got everything working!!!! :lol: :lol: :lol: It WAS a coding error on my part, so I do apologise for believing otherwise! But I believe that it might be one that is easy to stuff up for anybody who is not too careful - so will post it up tomorrow in here, that way other people installing it can be aware of it also.

So happy to finally get it going though!!! Now I have the tedious task of re-handing out all our posting milestone MODs to our 700 or so members :roll: Fun, lol!

I do have a couple of suggestions to contribute as well, but will save them for tomorrow also ;) Its 1am here and I am off to bed now! :P

User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan
Contact:

Re: [Alpha] Medal System MOD for phpBB3

Postby Gremlinn » Thu Sep 27, 2007 3:15 pm

RedTrinity: You are right. I haven't seen him doing anything anywhere I looked. I am just continuing. If he would like it back, I would be happy to transition it back as I know this is going to be a lot of work. And thanks for the help with this.

The language edits are funny. I don't have them in mine. Just the medals.php language file. But, haven't had time to look at it yet. I am at work. :o I plan on getting sometime today to look at it. i should have some status by morning tomorrow (EDT)
.:: Medal System MOD for phpBB3 :: Country Flag User Edition :: Roster Mod ::.

Please no PM Support questions.
My phpmod site: http://test.dupra.net/

Thunderz
Registered User
Posts: 10
Joined: Thu Sep 06, 2007 4:26 pm

Re: [Alpha] Medal System MOD for phpBB3

Postby Thunderz » Thu Sep 27, 2007 5:27 pm

gettin a error

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Program Files\xampp\htdocs\viewtopic.php on line 1368

SocomNutzClan
Registered User
Posts: 39
Joined: Fri Mar 02, 2007 11:05 pm

Re: [Alpha] Medal System MOD for phpBB3

Postby SocomNutzClan » Thu Sep 27, 2007 8:25 pm

I am very interested in this MOD. I am willing to donate $10 to the cause to get this MOD working.

User avatar
.:: Chico ::.
Registered User
Posts: 463
Joined: Fri Aug 03, 2007 6:35 am
Location: Rio de Janeiro
Contact:

Re: [Alpha] Medal System MOD for phpBB3

Postby .:: Chico ::. » Thu Sep 27, 2007 9:36 pm

Gremlinn wrote:RedTrinity: You are right. I haven't seen him doing anything anywhere I looked. I am just continuing. If he would like it back, I would be happy to transition it back as I know this is going to be a lot of work. And thanks for the help with this.


Me too, he isn't around here since 9th august.

if you could (and if you wanna, of course) continue the "thanked post mod", by geofreak too, tell us, please.

And thanks to continue medal system mod.

User avatar
Gremlinn
Registered User
Posts: 2133
Joined: Mon Aug 04, 2003 12:13 am
Location: Rochester, NY
Name: Nathan
Contact:

Re: [Alpha] Medal System MOD for phpBB3

Postby Gremlinn » Thu Sep 27, 2007 10:23 pm

Thunderz: Make sure you didn't miss a comma or slip the code into the wrong line. That would be the most likely cause of that error.

Chico: I am not interested in taking over any other mods. I am in need of this one and that is why I am working it.

RedTrinity: I did the install again. Sorry, I didn't get the problems you did. Make sure you did before and after inserts in the right spots ;) Do you have other mods installed? It's possible one of them is possible in the way.
.:: Medal System MOD for phpBB3 :: Country Flag User Edition :: Roster Mod ::.

Please no PM Support questions.
My phpmod site: http://test.dupra.net/

User avatar
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [Alpha] Medal System MOD for phpBB3

Postby RedTrinity » Fri Sep 28, 2007 1:14 am

Ok here is the spot where I found the misplaced edit last night which I thought I might share as due to confusion it may happen to other users as well whilst they are installing:

Open: memberlist.php

Find

Code: Select all

      if (!$member)
      {
         trigger_error('NO_USER');
      }


Add after

Code: Select all

      //
      // Medals System MOD
      //
         $user->add_lang('mods/medals');   
         
         $sql = 'SELECT *
               FROM ' . $table_prefix . "medals_cats
               ORDER BY order_id";
            $result = $db->sql_query($sql);
            $cats = array();
            while ($row = $db->sql_fetchrow($result))
            {
               $cats[$row['id']] = array(
                  'name'       => $row['name'],
                  'id'   => $row['id'],
                  'order_id'   => $row['order_id'],
               );
            }
            $db->sql_freeresult($result);
            
         $sql = 'SELECT *
               FROM ' . $table_prefix . "medals
               ORDER BY order_id";
            $result = $db->sql_query($sql);
            $medals = array();
            while ($row = $db->sql_fetchrow($result))
            {
               $medals[$row['id']] = array(
                  'name'       => $row['name'],
                  'image'       => $row['image'],
                  'cat_id'   => $row['parent'],
                  'order_id'   => $row['order_id'],
               );
            }
            $db->sql_freeresult($result);
            
         $sql3 = 'SELECT *
               FROM ' . $table_prefix . "medals_awarded
               WHERE user_id = $user_id";
         $result3 = $db->sql_query($sql3);
         $s_medals = false;
         $users_medals = array();
         while ($row3 = $db->sql_fetchrow($result3))
         {
            if ($row3['nominated'])
            {
               continue;
            }
            $this_cat = $cats[$medals[$row3['medal_id']]['cat_id']];
            $users_medals[$this_cat['order_id']]['name'] = $this_cat['name'];
            $users_medals[$this_cat['order_id']][$medals[$row3['medal_id']]['order_id']][] = array(
               'MEDAL_NAME'      => $medals[$row3['medal_id']]['name'],
               'MEDAL_IMAGE'      => '<img src="' . $phpbb_root_path . 'images/medals/' . $medals[$row3['medal_id']]['image'] . '" alt="' . $medals[$row3['medal_id']]['name'] . '" />',
               'MEDAL_ID'         => $row3['medal_id'],
            );
            $s_medals = true;
         }
         $db->sql_freeresult($result3);
         
         $my_medals_arr = array();
         ksort($users_medals);
         foreach ($users_medals as $key => $value)
         {
            ksort($value);
            foreach ($value as $key2 => $value2)
            {
               if ($key2 != 'name')
               {
                  foreach ($value2 as $key3 => $value3)
                  {
                     $my_medals_arr[] = array($value3, false);
                  }
               }
               else
               {
                  $my_medals_arr[] = array($value2, true);
               }
            }
         }

         $on_left = false;

         foreach ($my_medals_arr as $key => $value)
         {
            if (!$value[1])
            {
               $template->assign_block_vars('medals', array(
                  'MEDAL_NAME'      => $value[0]['MEDAL_NAME'],
                  'MEDAL_IMAGE'      => $value[0]['MEDAL_IMAGE'],
                  'IS_CAT'         => false,
                  'MEDAL_ID'         => $value[0]['MEDAL_ID'],
               ));
            }
            else
            {
               $on_left = !$on_left;
               $template->assign_block_vars('medals', array(
                  'MEDAL_NAME'      => $value[0],
                  'IS_CAT'         => true,
                  'ON_LEFT'         => $on_left,
               ));
            }
         }
         $is_mod = $auth->acl_get('m_');
         
      //
      // ----------------------------------
      //


If others do MOD installations like I do, they would automatically do a search for the unique line closest to the bottom of the code to locate:
trigger_error('NO_USER');
- because the code being added follows on afterwards. But it turns out that there are multiple instances of this same line throughout memberlist.php which is how I ended up putting the code in the wrong place!

So just letting everybody know not to search for
trigger_error('NO_USER');
and look for the
if (!$member)
line of this edit instead, as this will bring up the right spot to make the edit :)

I realise its an error on my part, just thought I would share as no doubt other users will accidentally do the wrong thing as well (I get the impression some already did in the older thread as they were having the same probs as me) - and by not putting this block of code in the right place will prevent the Medal MOD from functioning properly!

Hope that helps :)


Return to “[3.0.x] Abandoned MODs”

Who is online

Users browsing this forum: No registered users and 9 guests