![]() |
Home Community Mys-Script Creative Off-Topic |
|
![]() |
|
Thread Tools | Display Modes |
#11
|
||||
|
||||
![]()
What would I use to create a variable to pull from the owned adoptables table in the SQL database?
|
#12
|
||||
|
||||
![]()
Ok, so I got it working. Cludged a little of the code from here together with some of Kyttias' code.
PHP Code:
|
#13
|
|||
|
|||
![]()
The reason the above code works is because we could get it working as a module in the ACP, which won't accept if else statements. Don't know if that's the case with coding it in the file, but it's likely.
|
#14
|
||||
|
||||
![]()
That is certainly curious, I have the favpet in my sidebar (and elsewhere on my site) using Kyttias's code without any issues.
Did you make sure to leave the code sections in the widget blank? The widget only exists for you to actually place within the sidebar, but no code goes into it via the ACP.
__________________
My Mods Site (1.3.4, 2020 Mods) |
#15
|
|||
|
|||
![]() Quote:
|
#16
|
||||
|
||||
![]() Quote:
As it stands, I have the following code, emplaced within the PHP box of a new module. However, it seems that the if statement is causing some manner of issue - it works flawlessly if the user HAS set a favourite pet, but the entire site returns a 500 error if not, and they are logged in. PHP Code:
Last edited by KatFennec; 04-25-2017 at 07:52 PM. |
#17
|
||||
|
||||
![]()
I have the function in classes/class_siderbar as this;
PHP Code:
__________________
My Mods Site (1.3.4, 2020 Mods) |
#18
|
||||
|
||||
![]()
OK, so I think I've narrowed down the problem - it looks like getFavpetID() is NOT returning a 0 when there is no favourite pet assigned. Which is particularly strange, seeing as I poked through the databases, and it most certainly SHOULD be returning a zero.
|
#19
|
||||
|
||||
![]()
In an attempt to confirm my findings, I attempted to create a module to return the FavPetID.
PHP Code:
|
#20
|
|||
|
|||
![]()
I fixed it, by suggesting that the part defining the owned adoptable class be moved to where it definitively exists after the install in WAMP threw an error that told me what the problem was. Oops.
|
![]() |
|
|
What's New? |
What's Hot? |
What's Popular? |