Welcome Guest[3.145.164.47], connected from
If users not logged in then display ads?
|
Post: #1
|
|||
|
|||
If users not logged in then display ads?
I want to integrate text link ads into my forum but do not want my registered members to see them. the javascript code to integrate the ads needs to be placed directly before the </body> for loading purposes I guess.
No i don't need any mod/plugin i just need a code to hide text from logged users and only show it for guests. Are there any codes to do this?? |
|||
Post: #2
|
|||
|
|||
RE: If users not logged in then display ads?
Normaly any ads javascript code could be put anywhere in the < body > part.
The way to know if the user is a guest, is to verify if he have no User ID using this PHP code : PHP Code:[Highlight] if($mybb->user['uid'] == 0){ |
|||
Post: #3
|
|||
|
|||
RE: If users not logged in then display ads?
(09-11-2010 01:37 PM)exdiogene Wrote: Normaly any ads javascript code could be put anywhere in the < body > part. I tried with your code but did not work. Maybe you have not understood me correctly. Let say i have this code and i just want to hide this code from inlogged users. The code to show for guests ''Welcome guest, please register to remove ads.'' Well the ''hide'' tag should be added before the begin of the code and in the end of it. To make you really understand what I mean, I have found this code from phpbb Code:[Highlight] <!-- IF not S_USER_LOGGED_IN and not S_IS_BOT --> I know that Mybb and phpBB is not the same but I have used phpbb in 2 years and it was the only way to explain what code I'm looking for. A kind of code that has phpbb should be even for Mybb. |
|||
Post: #4
|
|||
|
|||
RE: If users not logged in then display ads?
With MyBB you cannot put conditionals inside templates unless you have a plugin allowing it to execute.
The code i have supplied you, was for plugins or core files, it cannot be used inside templates. If you need something like this to control ads in your footer and do not want a plugin to do so, then you are left with the only possibility to modify your core files. |
|||
Post: #5
|
|||
|
|||
RE: If users not logged in then display ads?
Ok that made me sad...
I really needed to hide some codes in my site footer (In of the forum) for logged users... Read PM |
|||
0 member(s) viewed this thread in the last 365 days :
|
« Next Oldest | Next Newest »
|
WWWHostingServer.com
|
||||||
|
||||||
|
Possibly Related Threads... | |||||
Thread: | Author | Replies: | Views: | Last Post | |
How can I view all the users registered with a particular email? | roger | 4 | 1,256 |
12-09-2009 06:05 AM Last Post: babjusi |
|
|
|
|
Powered By MyBB, © 2002-2024 MyBB Group. Golden Crown - Designed and Published by ghazal & exdiogene of MyBBCodes. Hosting provided by WWWHostingServer.com |