Advertisement:

Author Topic: vMulticolor-Stars Mod  (Read 66055 times)

Offline dry3210

  • Jr. Member
  • **
  • Posts: 165
  • Gender: Male
    • Northeast Sportbikes
Re: vMulticolor-Stars Mod
« Reply #120 on: March 23, 2010, 02:04:13 PM »
Valodim,
I have used this Mod for a couple of years on my 1.1.x site and it is very popular.  It works perfectly for what I need to do (attached image).  I'm wondering if you have any future plans to upgrade this to work with RC3 as I am currently planning on upgrading my site soon.
ZarPrime

Agreed.  Very nice mod and hoping on an update

Offline ZarPrime

  • Jr. Member
  • **
  • Posts: 135
Re: vMulticolor-Stars Mod
« Reply #121 on: April 07, 2010, 11:19:15 AM »
Valodim,


I know that you still check in here once in awhile.  I really need an answer to my previous question, if possible.  To reiterate, will you be doing an update to make this Mod work with SMF 2.0 RC3?  There are many changes between SMF 2.0 beta 3 and RC3.  A simple "Yes" or "No" will suffice.  If the answer is no, I will not continue to waste time checking this topic.


Thank You,
ZarPrime

TheListener

  • Guest
Re: vMulticolor-Stars Mod
« Reply #122 on: April 07, 2010, 11:24:15 AM »
Zarprime

Have you looked at using a mod such as this one?

http://custom.simplemachines.org/mods/index.php?mod=1733


Offline ZarPrime

  • Jr. Member
  • **
  • Posts: 135
Re: vMulticolor-Stars Mod
« Reply #123 on: April 07, 2010, 11:52:14 AM »
No, I haven't looked at that one yet but I will.  It looks like it hasn't been updated for RC3 either though.


Thanks,
ZP

Offline oridyne

  • Semi-Newbie
  • *
  • Posts: 52
  • Gender: Male
    • @@BBBBForum on Twitter
    • Big Bang Burger Bar
Re: vMulticolor-Stars Mod
« Reply #124 on: February 27, 2017, 03:16:40 AM »
My forum suffered some rather serious errors after installing your mod. Certain threads would be "broken", making it impossible to make a reply to that thread (reply would be lost). I reported it and SleePy fixed it up:

Quote from: SleePy
Your error log had lots of entries so I emptied it and viewed that topic and got these errors:
Database error, given array of integer values is empty.
Database error, given array of integer values is empty.
Function: loadStars
File: /home/radakano/public_html/forums/Sources/Load.php
Line: 1447

8: Undefined index: groupName
File: /home/radakano/public_html/forums/Sources/Load.php
Line: 1450

I fixed both of them. They look related to the vMulticolor-Stars Mod. You should inform the mod author of those two errors. The second one was easiest to fix and the first one I just make a work around to keep the errors from occurring :)
It has also greatly bothered me that your mod is not possible to uninstall. If I recall correctly, this was not possible in 1.1.4 either (I'm running a 2.0 Beta 3.1 board). Please direct your attention to these errors and see what can be done about it.
Still awaiting a reply on this one.

On another note, I would very much appreciate a proper update for Beta 3.1 and 4.0 public accompanied by a working uninstaller. We're trying to update our forum from 3.1 to 4.0, but our webmaster says that there are too many mods "in the way". I've uninstalled nearly all our mods, yet a few returned errors, yours included, which I suspect is the reason why we can't make the update just yet.

I'd be happy to give you full access to our forum if you'd like to take a closer look at the errors.

I'm just in the process of testing updating my site from SMF1.1.21 to SMF2.0.13 and this was one of the mods causing me headaches as it appears broken under SMF2. I had the same errors as you, I managed to fix the first by finding the code in Load.php where it was using "group_name" then later using "GroupName" so simple typo easy fix. The database error I can see it relates to the database query code from the mod in Load.php but it is a little beyond my knowledge to rectify. Any idea what Sleepy did to fix it or work around it? Alrternatively could you post a copy of your load.php so I can compare.  Though given the age of this thread I suspect this is a looooong shot by now :)

I'll either have to miss this mod off the migration list or hope beyond hope this gets updated or someone else does something similar in another mod one-day..

<*> I'm dangerous when I know what I'm doing <*>

Big Bang Burger Bar

Offline oridyne

  • Semi-Newbie
  • *
  • Posts: 52
  • Gender: Male
    • @@BBBBForum on Twitter
    • Big Bang Burger Bar
Re: vMulticolor-Stars Mod
« Reply #125 on: February 27, 2017, 03:39:12 AM »
Code: [Select]
    // load those not yet loaded
    if(!empty($groupsToLoad)){
        // exluce all with minPosts = -2, so we don't get warning "stars" here! (for vWarn mod)
        $result = $smcFunc['db_query']('', "
            SELECT id_group, group_name, stars
                FROM {db_prefix}membergroups
                WHERE id_group IN ({array_int:groupsToLoad})
                    AND min_posts != -2", array(
            'groupsToLoad' => array_filter($groupsToLoad),
        ));
        while($row = $smcFunc['db_fetch_assoc']($result)) {
            $groupData[$row['id_group']] = explode('#', $row['stars']);
            $groupData[$row['id_group']]['name'] = $row['groupName'];
        }
    }

I just had another look at the code and compared it to the previous version and I think in fixing the typo I went with the wrong "fix" I changed groupName to group_name to match the select version when it should have been groupName for both. I'll try this again tonight on my test site to see if this now fixes my database error.  I was working on this late at night so I should have waited until I took a fresh look at the code before posting ;)

Hopefully, if this works, these posts will serve as a help to anyone else encountering the issues.

<*> I'm dangerous when I know what I'm doing <*>

Big Bang Burger Bar

Offline oridyne

  • Semi-Newbie
  • *
  • Posts: 52
  • Gender: Male
    • @@BBBBForum on Twitter
    • Big Bang Burger Bar
Re: vMulticolor-Stars Mod
« Reply #126 on: February 27, 2017, 12:53:12 PM »
Ah, so checking the new database the table name is group_name  so I was definitely right first time. So there is an issue with that code segment that causes a DB error on some posts.

I'll have to hope people are still reading this thread and that they are able to help...

Code: [Select]
function loadStars($maingroup, $groups, $postgroup){
    global $smcFunc, $context, $modSettings, $settings, $ID_MEMBER;

    // we cache the membergroups here, and try to load as many of them at once as possible :)
    static $groupData = array();

    // nothing to do?
    if(empty($groups) && empty($postgroup))
        return '';

    // !!! maybe loading all groups at once would save some time?? not sure.

    // get all unloaded groups
    $groupsToLoad = array_diff(empty($modSettings['postGroupStars']) ? array_merge($groups, array($postgroup)) : array($maingroup, $postgroup), array_keys($groupData));

    // load those not yet loaded
    if(!empty($groupsToLoad)){
        // exluce all with minPosts = -2, so we don't get warning "stars" here! (for vWarn mod)
        $result = $smcFunc['db_query']('', "
            SELECT id_group, group_name, stars
                FROM {db_prefix}membergroups
                WHERE id_group IN ({array_int:groupsToLoad})
                    AND min_posts != -2", array(
            'groupsToLoad' => array_filter($groupsToLoad),
        ));
        while($row = $smcFunc['db_fetch_assoc']($result)) {
            $groupData[$row['id_group']] = explode('#', $row['stars']);
            $groupData[$row['id_group']]['name'] = $row['group_Name'];
        }
    }

    // stars string (the result)
    $stars = '';

    // default multicolor-stars mode
    if(empty($modSettings['postGroupStars'])) {

        $starcount = 0;

        // and build up the groups
        foreach($groups as $current)
            // only groups with actual stars count
            if(!empty($groupData[$current]) && !empty($groupData[$current][0]) && !empty($groupData[$current][1])) {
                $stars .= str_repeat('<img src="' . $settings['images_url'] . '/' . str_replace('$language', $context['user']['language'], $groupData[$current][1]) . '" title="' . $groupData[$current]['name'] . '" alt="*" border="0" />', $groupData[$current][0]) . (!empty($modSettings['brBetweenStars']) ? '<br />': '');
                $starcount += $groupData[$current][0];
            }

        // fill the "remaining" empty places with normal post-stars
        if(!empty($groupData[$postgroup][0]) && !empty($groupData[$postgroup][1]) && (!empty($modSettings['forcePostStars']) || ($groupData[$postgroup][0] - $starcount) > 0))
            $stars .= str_repeat('<img src="' . $settings['images_url'] . '/' . $groupData[$postgroup][1] . '" alt="*" border="0" />', empty($modSettings['forcePostStars']) ? ($groupData[$postgroup][0] - $starcount) : $groupData[$postgroup][0]);

    // this setting means that the number of stars is determined by postgroup, but the color is the main group.
    } else {
        if(!empty($groupData[$postgroup][0]) && !empty($groupData[$postgroup][1])) {
            if(!empty($groupData[$maingroup][0]) && !empty($groupData[$maingroup][1]))
                $stars .= str_repeat(str_repeat('<img src="' . $settings['images_url'] . '/' . $groupData[$maingroup][1] . '" alt="*" border="0" />', $groupData[$maingroup][0]) . (!empty($modSettings['brBetweenStars']) ? '<br />': ''), $groupData[$postgroup][0]);
            else
                $stars .= str_repeat('<img src="' . $settings['images_url'] . '/' . $groupData[$postgroup][1] . '" alt="*" border="0" />' . (!empty($modSettings['brBetweenStars']) ? '<br />': ''), $groupData[$postgroup][0]);
        }
    }


    return $stars;
}
<*> I'm dangerous when I know what I'm doing <*>

Big Bang Burger Bar

Offline Drakkon

  • Semi-Newbie
  • *
  • Posts: 28
Re: vMulticolor-Stars Mod
« Reply #127 on: April 08, 2018, 05:42:50 AM »
Is there a way I can install this on 2.0.15 ?

Offline niraj

  • Semi-Newbie
  • *
  • Posts: 12
Re: vMulticolor-Stars Mod
« Reply #128 on: September 19, 2018, 08:22:30 AM »

I'm also looking to install it on SMF 2.0.15 but it doesn't support 2.0.15 Is there any alternative mod with the same functionality supporting 2.0.15 ?

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,873
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: vMulticolor-Stars Mod
« Reply #129 on: September 19, 2018, 08:39:27 AM »
I'm not sure but you can try emulating the required version of SMF. It should work as such, I have not tried it, You can see it in the wiki with the following link How can I install a mod that doesn't work in my SMF version?.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal