101
aerograf
Re: Problems with Soapbox
  • 2017/5/23 13:01

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


It seems that this function does not work ...
public function updateRating(&$sbarticle$force false)
    {
        if (
strtolower(get_class($sbarticle)) !== strtolower('SoapboxSbarticles')) {
            return 
false;
        }
        
$totalrating 0.00;
        
$votesDB     0;
        
$finalrating 0;

        
$sbvotedata_arr =& $this->getVotedatasByArticleID($sbarticle->getVar('articleID'), true00);
        
$votesDB        count($sbvotedata_arr);
        if (empty(
$sbvotedata_arr) || $votesDB === 0) {
            return 
false;
        }
        foreach (
$sbvotedata_arr as $sbvotedata) {
            if (
is_object($sbvotedata)) {
                
$totalrating += $sbvotedata->getVar('rating');
            }
        }
        if (
$totalrating !== && $votesDB !== 0) {
            
$finalrating = ($totalrating $votesDB) + 0.00005;
            
$finalrating number_format($finalrating4);
        }
        
//
        
$sbarticle->setVar('rating'$finalrating);
        
$sbarticle->setVar('votes'$votesDB);
        if (!
$this->insertArticle($sbarticle$force)) {
            return 
false;
        }

        return 
true;
    }



102
aerograf
Re: Problems with Soapbox
  • 2017/5/23 6:50

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Mamba thanks. It was fixed.
But still, for some reason, the result of voting in the database table "__sbarticles" is not recorded.
The table "__sbvotedata" is written, as it was, but not written to the main data. Why, I can not understand.
In debugging, all functions work, but there is no record in the database



103
aerograf
Re: Problems with Soapbox
  • 2017/5/22 17:55

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


XOOPS 2.5.9-Beta3
PHP 7.0.17 (For which I plan to move, so I prepare modules for it)
MYSQL 5.7.13-6-log
I think we'll sort out what the problem is.



104
aerograf
Re: Problems with Soapbox
  • 2017/5/22 17:13

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Tried it differently. There is an opinion that you have slightly changed xoops
Well, or I have already clogged xoops, all the same experiments also make themselves felt.
But this option does not work.



105
aerograf
Re: Problems with Soapbox
  • 2017/5/22 13:27

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Does not work...
soapbox 1.70 XOOPS 2.5.9-Beta3
Предупреждениеconstant(): Couldn't find constant SOAPBOX_DIRNAME в файле /modules/soapbox/include/config.php строка 26
Уведомление: Undefined index: uploaddir в файле /modules/soapbox/include/config.php строка 37
Предупреждение: constant(): Couldn'
t find constant soapbox_AUTHOR_LOGOIMG в файле /modules/soapbox/include/config.php строка 96



106
aerograf
Re: Problems with Soapbox
  • 2017/5/20 15:53

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


I hope people understand ...



107
aerograf
Re: Problems with Soapbox
  • 2017/5/20 15:25

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Thank you.
Be sure to write the result.



108
aerograf
Re: Problems with Soapbox
  • 2017/5/19 12:23

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


It may be that I have already copied something and as a result does not work. Or maybe that PHP7 is worth it. Thank you. I will look further.



109
aerograf
Re: Problems with Soapbox
  • 2017/5/19 11:33

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Thank you. But the rating does not work
I'll understand further. But the idea is clear.
The result is recorded in the voting table, and the main result is not written.



110
aerograf
Re: Problems with Soapbox
  • 2017/5/15 18:02

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


I'm trying to figure out the rating all the same.
The data in the database sdvotedata are recorded, but there are no number of sbarticles voted in the votes. Where can be the problem?




TopTop
« 1 ... 8 9 10 (11) 12 13 14 ... 21 »



Login

Who's Online

173 user(s) are online (108 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits