Questions surrounding classes and Rev

SaW

Member
Mar 3, 2018
101
15
So i just started learning OOP PHP aswell as functions, and some things doesn't make sense to me when i look at how RevCMS works.
1. How does fx. {username} work, and how does it call it from the class without the class being included in the page?
2. Gonna be converting from mysql to mysqli, and therefore i want to use the engine for queries, but I'm not sure on how to include the class in my pages.

I'm aware these are vague and odd questions, but I find myself very confused, so please inform me if I'm talking gibberish. Thx.
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
The parameters like {username} are defined in the template file under the app folder. They are called from the Global.php and they reference to the Session variable which is why they don't update on every page, only on login

MySQL to MySQLi is a long process for Rev but all of your functions should be defined in the app folder classes which are called from the Global.php file
 

SaW

Member
Mar 3, 2018
101
15
The parameters like {username} are defined in the template file under the app folder. They are called from the Global.php and they reference to the Session variable which is why they don't update on every page, only on login

MySQL to MySQLi is a long process for Rev but all of your functions should be defined in the app folder classes which are called from the Global.php file
Appreciate it. Though what do i do wrong here then?
You must be registered for see images attach

Got this code on my /me page, and i get this err:
 

SaW

Member
Mar 3, 2018
101
15
Still not it:
You must be registered for see images attach

You must be registered for see images attach


*EDIT
Looking at others global.php, they have just made a new function in the global.php. I just don't get why it won't let me access the function in my other pages.
You must be registered for see images attach
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
You cannot call the Global.php function from your engine class. The global.php has a reference to the engine, but the engine does not have a reference to the Global.

Show me your whole method and where you are setting {coins}

and why is your column called 'usersCurrency' from the database?
 

SaW

Member
Mar 3, 2018
101
15
{coins} has nothing to do with this, was just to show the fatal error i was getting.
This is the method that i am trying to call, which is in class.engine.php:
You must be registered for see images attach

I'm just testing to see if my engine methods work, as i find them more practical when using mysqli.
Using arcturus database, therefore users_currency.
 

SaW

Member
Mar 3, 2018
101
15
If you don't have that column in the database it ain't going to work
I do have that table in my database. That isn't the problem, as it works before trying the $engine->query() method.
 
Why would u even call the engine i dont use rev myself but it seems like it isnt needed at all in this case
Allowing me to include the dbconn in the functions without having to call it everytime i guess. I'm still getting around the basics, so if you've got any suggestions I'm all ears. :)
 

Object

?
Nov 10, 2017
415
328
I do have that table in my database. That isn't the problem, as it works before trying the $engine->query() method.
 

Allowing me to include the dbconn in the functions without having to call it everytime i guess. I'm still getting around the basics, so if you've got any suggestions I'm all ears. :)
I realised hence i deleted my post haha. I dont know how revcms works at all so i have no clue sry
 

Users who are viewing this thread

Top