Author |
Message |
Dawg
RavenNuke(tm) Development Team
Joined: Nov 07, 2003
Posts: 928
|
Posted:
Thu Jan 21, 2016 3:53 pm |
|
I can get the banners to display in the forums but I can not get them to rotate. I get the same banners over and over. Does anyone know how I can the tpl to except a php function or a call to ads(0)
Thank You for your help.
Dawg |
|
|
|
|
neralex
Site Admin
Joined: Aug 22, 2007
Posts: 1774
|
Posted:
Fri Jan 22, 2016 2:46 am |
|
You are running the same function call in another part of your website or only in the forums module? You can try to create a new position and call the function with the new postition ID like ads(2).
0 = Page Top
1 = Page Header
The next would be 2, call it forums and assign your banners there. Sometimes if you are using many banners on the same position it could be you have to reload the website more than 2 times before a new banner is shown. While testing make sure that some kinds of adblockers are disabled in your used browser. |
_________________ Github: RavenNuke |
|
|
|
Dawg
|
Posted:
Fri Jan 22, 2016 6:36 am |
|
Neralax, Thank you for the help.
I have a lot of banners throughout the site. All of it works as expected.
The issue I am running into
In page_header.php around line 400
Code:
$ads1 = ads('3');
$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'SITE_DESCRIPTION' => $board_config['site_desc'],
'PAGE_TITLE' => $page_title,
'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),
'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
'TOTAL_USERS_ONLINE' => $l_online_users,
'LOGGED_IN_USER_LIST' => $online_userlist,
'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
'PRIVMSG_IMG' => $icon_pm,
'ADS1' => $ads1,
'ADS2' => $ads2,
|
In index_body.tpl I am calling the ads like this...
Code:
<td width="50%" align="center">
{ADS2}
</td>
|
So the issue I am seeing is smarty is outputting the entire page at once (As it should) but the ad calls are not refreashed everytime one is hit. So I wide up with only 2 ads repeated everytime.
In the rest of RN....We make a call to
If I want 2 ads in that space I just call the function X2. I am trying to figure out how to do that inside the forums.
I have a new found HATE for smarty at this point.
If You can point me in the right direction....PLEASE!!
Thank You for your help.
Dawg |
|
|
|
|
neralex
|
Posted:
Fri Jan 22, 2016 7:18 am |
|
I tried it on the same way in the page_header.php
Code:$ads0 = ads(0);
$ads1 = ads(1);
$template->assign_vars(array(
'ADS0' => $ads0,
'ADS1' => $ads1,
|
After that I tested {ADS0} and {ADS1} together in page_header.tpl and index_body.tpl of my theme without any issues - it works on my end. |
|
|
|
|
Dawg
|
Posted:
Fri Jan 22, 2016 8:50 am |
|
I can get it to display no problem. What I was trying to do was to get it display 2 ads at the bottom of each Cat.
The problem was and is that I get the same 2 ads after each Cat.
What I am after is different ads after each Cat.
Thank You for the help.
Dawg |
|
|
|
|
neralex
|
Posted:
Fri Jan 22, 2016 4:15 pm |
|
Ok I got it reproduced and I guess I found the solution.
Let us start in the index.php of the Forums module and search:
php Code:$template->assign_block_vars('catrow', array(
|
after add:
php Code:'ADS' => ads(0),
|
Open index_body.tpl of your used theme and find:
html Code:<!-- END catrow -->
|
Add before this line: {catrow.ADS}
Now is the question how your forum-template was builded but normally <!-- END catrow --> is placed after the last </tr> before </table>. In my own theme it looks like this:
html Code: </tr>
<!-- END forumrow -->
<tr>
<td colspan="5">{catrow.ADS}</td>
</tr>
<!-- END catrow -->
</table>
|
After <!-- END forumrow --> and before <!-- END catrow --> I added a new <tr> with a single <td> and the attribute colspan with the number of rows to get a 100% width for the function-call.
I hope it helps.
|
|
|
|
|
Dawg
|
Posted:
Fri Jan 22, 2016 5:46 pm |
|
neralex,
Ding Ding Ding....We have a WINNER!
You are my HERO! I have banged my head for a couple days over this issue. Thank You for your help!
Dawg |
|
|
|
|
neralex
|
Posted:
Fri Jan 22, 2016 6:26 pm |
|
|
|
|
|