MyBB-Plugins Forums
Advertisements with variabile - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: MyBB General Discussion (http://forums.mybb-plugins.com/Forum-MyBB-General-Discussion)
+--- Forum: Coding Help (http://forums.mybb-plugins.com/Forum-Coding-Help)
+--- Thread: Advertisements with variabile (/Thread-Advertisements-with-variabile)



Advertisements with variabile - HostFat - 10-11-2012

I'm trying to put a variable in the My Advertisments mod: {$post['fid6']}
I saw that it doesn't work.

So my idea is adding some javascript code in myadvertisments.php and put the variable {$post['fid6']} in a javascript variable.

Then I'll add the javascript variable in the advertisement code.

Is this the right direction or are there other better ways?


RE: Advertisements with variabile - Diogo Parrinha - 10-11-2012

You could do that but if you're going to use javascript to replace {$post['fid']} - which I am not sure if gets eval'd or not (can't remember if MyAdvertisements inserts the ad code after the MyBB templates are eval'd or not) - you can just use the actual value?


RE: Advertisements with variabile - HostFat - 10-11-2012

The value is dynamic.
Every user has a different value.

I copy here what I wrote on the mybb board.
If you already know that it's not possible/easy, this can be a feature request, and I'll pay the 7$ for it.

Quote:I added Coinurl to my board, and it works well:
Banner example:
Code:
<iframe scrolling="no" style="border: 0; width: 728px; height: 90px;" src="http://coinurl.com/get.php?id=1352"></iframe>

But I want to do more.
Coinurl offer a feature called "revenue sharing".
With this code:
Code:
<iframe scrolling="no" style="border: 0; width: 468px; height: 60px;" src="http://coinurl.com/get.php?id=slot-id&share=address"></iframe>
If I enter a Bitcoin address in share=address (ex: share=1HostFatgTXWdRmVoneC8M6ErhiuQ7An5o ), the address will get a % of the income from the click on the banner.

I have added a "Custom Profile Field" called "Bitcoin address".
So every user can now enter his own Bitcoin address in his profile.

What I trying to get is that all banners will show with the bitcoin address of the user that started the topic.
I want to give some of the income to users that actively participate to the board.

I'm using the "My Advertisements (2.0.3)" mod right now.
I tried to enter something like this:
Code:
<iframe scrolling="no" style="border: 0; width: 728px; height: 90px;" src="http://coinurl.com/get.php?id=1249&share={$post['fid6']}"></iframe>
But it didn't work.

Can you give me some advice? Smile

EDIT:
Is it better to move this topic to "MyBB 1.6 General Support" ?



RE: Advertisements with variabile - Diogo Parrinha - 10-11-2012

Ah well that requires some changes to the inner workings of the plugin. What do you mean by "paying the $7"?. If you are talking about subsciribing, that has nothing to do with requests being fulfilled.


RE: Advertisements with variabile - HostFat - 10-11-2012

honestly. do you think that it's better that I'll add banners by myself in the code ( without using your mod ) or waiting for a possible modification of your mod? Sleepy


RE: Advertisements with variabile - HostFat - 10-12-2012

Ok, solved.
I just put the ads code directly on the template.
Thank you anyway Smile


RE: Advertisements with variabile - HostFat - 10-12-2012

Damn it, I thought it was easier.
{$post['fid6']} isn't the right thing, I need the fidX of the thread starter.


RE: Advertisements with variabile - Diogo Parrinha - 10-12-2012

I'm sorry but I cannot help you with this. This forum is for those who understand PHP and MySQL but need help with this or that, or suggestions on how to do this or that. Not for people who know nothing about it and need general support - which is pretty much what you're asking here.