PDA

View Full Version : Guests


Kyttias
02-03-2014, 06:02 PM
You just gave (name of adoptable) one LevelUP Point.
Be sure and come back again tomorrow to feed this adoptable.

You have earned 0 (name of currency) for leveling up this adoptable.
You now have (name of currency)

Can I put in a memo that guests probably should not be seeing the second two lines? I'm sure a way to disable this can be patched in, but for future reference, I'd consider this an issue...? (Is this the proper place to report this?)

IntoRain
02-03-2014, 07:23 PM
In the levelup php pages (1.3.4, so in two files. In 1.3.3 it's one file only), I added if($mysidia->user->username != NULL){} around the lines related to that part to fix it, like

if($mysidia->user->username != NULL){
$summary->add(new Comment("<br> You have earned {$reward} {$mysidia->settings->cost} for leveling up this adoptable. "));
$summary->add(new Comment("You now have {$mysidia->user->getcash()} {$mysidia->settings->cost}"));
}

and

$reward = 0;
if($mysidia->user->username != NULL){
$reward = $mysidia->user->clickreward($this->settings->reward);
$mysidia->user->changecash($reward);
}

There's other ways, maybe related to the usergroup, it was just the first thing I thought of

Kyttias
02-04-2014, 12:46 AM
Ah, thankyou. In v1.3.4, it seems the location of what I needed to change was in view/levelupview.php. I found the lines there to wrap in the NULL and it seems to work, now. (I couldn't find the second part? But I don't think I need it...)

This and the redirect after login definitely need to come standard in the soonest new version of Mysidia possible, I think. (And I'm still having trouble properly redirecting to the index on logout, but that's another matter entirely and I'll scratch my head some more over that later.)

IntoRain
02-04-2014, 07:14 AM
Ah the pages are divided into two. In view/somepageview.php you got the viewing aspect of the page and outside all folders you have the somepage.php that contains the verifications of access and submission of input fields. They seem to share information between each other through a hashmap, basically two functions: setField and getField. The second parameter of the function has to be an object
If the page is yourwebsite/levelup or yourwebsite/levelup/click then the information will be all in levelup.php (verifications) and levelupview.php (text displayed), then it will have the click() function there

The second one is not needed, since the text won't display anyway, it's just in case you want to prevent it at all from calculating a reward and trying to distribute it to visitors (they won't see the result anyway) xD

Hall of Famer
02-04-2014, 04:15 PM
This is not really a bug, but I agree it can be annoying to some users. I will see if I will fix it in Mys v1.4.0, good chance it will happen.

Anyway there's a reason why in Mys v1.3.4 you need to edit the file levelupview.php instead of the levelup.php file. The levelup.php contains a controller class, while levelupview.php is the view. If you understand what I mean by presentation logic, you'd know that what information to display is about the presentation of your site. For presentation logic, there's a good chance that you will find it in a view file rather than a controller file.