vMulticolor-Stars Mod

Started by Valodim, September 12, 2005, 08:29:54 PM

Previous topic - Next topic

dry3210

Quote from: zarprime on March 12, 2010, 11:41:43 AM
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

ZarPrime

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


ZarPrime

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

oridyne

Quote from: erlend_sh on September 09, 2008, 05:18:31 AM
Quote from: Sadr on June 08, 2008, 08:58:29 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: SleePyYour 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

oridyne

    // 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

oridyne

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...

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

Drakkon

Is there a way I can install this on 2.0.15 ?

niraj


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 ?

-Rock Lee-

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
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Advertisement: