 | [Solved] Adverts As Posts MOD |  |
Posted: 05/23/2007 9:02 AM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 3:01 AM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
Hi brother,
I just installed a small called Adverts As Posts and the MOD code is
| Code:
|
################################################################# ############################################
## MOD Title: Adverts In Posts
## MOD Author: Dale Rodgers < > (Dale Rodgers) http://www.tntboards.com
## MOD Description: Automatically displays an advert in a topic as a post.
## MOD Version : 1.3.7
##
## Installation Level : Easy
##
## Installation Time : ~30 Secs
##
## Files To Edit : viewtopic.php
##
##
## Included Files : None
##
##
###################################################################### ######################################
## For Security Purposes, Please Check: http://www.phpbbhacks.com/allhacks.php for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbbhacks.com/allhacks.php
###################################################################### ######################################
## Author Notes:
## This MOD was made to have adverts on your forum without ruining the design or looking nasty.
##
## - Abilty to change the advert
## - Ability to change how many ads are displayed per topic
###################################################################### ######################################
## Other Notes:
## You need to replace Ad Code Here with your ad code.
###################################################################### ######################################
###################################################################### ######################################
## MOD History:
##
##
## 2005-02-06 - Version 1.3.7
## - First release of the MOD
##
##
###################################################################### ######################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
###################################################################### ######################################
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$num ++;
#
#-----[ FIND ]------------------------------------------
#
'U_POST_ID' => $postrow[$i]['post_id'])
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
if($i == $ad_after)
{
$row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$num ++;
$mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'POST_DATE' => $post_date,
'POST_SUBJECT' => 'Advertisement',
'MINI_POST_IMG' => $mini_post_img,
'POSTER_NAME' => 'Advertisement',
'POSTER_RANK' => 'Advertiser',
'MESSAGE' => '<div align="center">Ad code here</div>',
'L_MINI_POST_ALT' => $mini_post_alt,
'U_MINI_POST' => $mini_post_url,
'U_POST_ID' => 'ad')
);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
It installed and working perfectly but in MOD description in phpbbhacks I read that I can show ads on 1st post and the last post but as you can see in my FunWadi, I see in second post. How to show this ads as first and last posts and rest posts in between  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Adverts As Posts MOD |  |
Posted: 05/24/2007 12:09 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:01 PM
Location: St Pete, FL
|

|
|
|
|
 |
To display this on every other post, I added the following line of code:
OPEN
viewtopic.php
FIND
| Code:
|
if($i == $ad_after)
{
|
AFTER, ADD
The MOD in it's unaltered state should never have worked though. The first pass through, $ad_after was not assigned any value, so the if statement should never have worked. I have no idea why it does even now since on the first pass through, i is assigned 1 and $ad_after is assigned nothing, so there should never be any equality...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] Adverts As Posts MOD |  |
Posted: 05/24/2007 1:50 AM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 3:01 AM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
Oh noo brother. I have already MOD installed called In-line AD MOD and that shows on every post or after 2 post also but I installed this MOD so I can put ad in such a way that first post should come as AD and than starts the topic original post and at the end the last post should be ad too so it means on every page only 2 ads. This is messing up whole forum by showing ads and ads
Is it possible what I want or I will remove this MOD because than there is no use of this MOD |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Adverts As Posts MOD |  |
Posted: 05/24/2007 2:21 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:01 PM
Location: St Pete, FL
|

|
|
|
|
 |
I'm sure this can be modified to do as you want, but I'm too tired to deal with it right now. We will have to look at it tomorrow after I've gotten some sleep...
I removed the code that I added so that it won't display on every other post...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] Adverts As Posts MOD |  |
Posted: 05/24/2007 2:23 AM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 3:01 AM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
Okay, No problem.
Thanks a lot  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Adverts As Posts MOD |  |
Posted: 05/24/2007 2:40 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:01 PM
Location: St Pete, FL
|

|
|
|
|
 |
I got it to display the ad at the top and bottom of every topic page. Is that what you had in mind???
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Adverts As Posts MOD |  |
Posted: 05/24/2007 2:40 PM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 3:01 AM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
Woww. You did it
There is minor problem left that last post where ads are there, on the left side panel it shows
11043 FW$
[ Donate ] and Medal picture (If someone have)
like this post
http://www.funwadi.com/forum/post118129.html#ad
So any way to make that FW$ up because it is of upper post but it is coming down. |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] Adverts As Posts MOD |  |
Posted: 05/24/2007 2:48 PM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 3:01 AM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
Here is the image which will make you easy to understand If I was not able to write properly.
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Adverts As Posts MOD |  |
Posted: 05/24/2007 3:20 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:01 PM
Location: St Pete, FL
|

|
|
|
|
 |
Yes, it is fixed now. Check it out...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] Adverts As Posts MOD |  |
Posted: 05/24/2007 3:27 PM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 3:01 AM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
Ah, now it's looking so nice. Hope to receive some good donation now as every one will see first donation picture and than the 1st original post
Thanks brother. I know it took a lot of time of yours
Btw brother, I just told my Main Moderator (name changed to Co-Admin) and will give him some more authorities in his MCP which I came to knew by reading the author's topic so I told him that to search some nice and cool phpBB templates/skin and I will search too........... I wish to receive your PM reply soon
Thank You,
Your bro,
AB |
|
|
 |
 |
| Back to Top |
|
|
 | Information |  |
|