REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 4 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Ad Manager v1.2
#31
Surprised MyBBCentral does not have better support. I wasn't able to get the plugin working. I decided to use the plugin from yaldaram. Yaldaram's plugins work the same way, but it actually works and good support.
Reply
#32
Thanks, just what I'm looking for.

EDIT: Plugin doesn't work, won't display anything and by the looks of this thread has been broken for awhile with no support. <sarcasm>So glad I paid for this</sarcasm>
Reply
#33
Plugins works perfectly fine for latest MyBB version. I use it all the time with zero problems.

Please explain the issues you're having.
Reply
#34
(May 22, 2012, 09:04 PM)labrocca Wrote: Plugins works perfectly fine for latest MyBB version. I use it all the time with zero problems.

Please explain the issues you're having.

The html comment tokens the myads function looks for to replace with the ad code don't exist and the plugin does not insert these tokens into any template so the ads never get inserted.

I've since fixed the plugin myself by adding some code to insert these tokens into the templates.

As a side note recommendation from another programmer. I also replaced the pointless preg_replace() the plugin was using to do so the actual insertion. preg_replace() is for regex, the plugin needs no regex to do a simple literal text replace; str_replace() is much faster in this case.

PHP Code:
//New replacer
$page str_replace('<!-- start: footer -->','<!-- start: footer --><div class="footerad" align="center">'.$mybb->settings['footad'].'</div>',$page);
//Original replacer
$page preg_replace('#'.preg_quote('<!-- start: footer -->').'#'"<!-- start: footer --><div class=\"footerad\" align=\"center\">"$mybb->settings['footad'] ."</div>"$page); 

Top line is both easier to read and performs better. Both because the usage of str_replace over regex. Plus the fundamental difference between single and double quotes, which is bigger than most people realize. A string in double quotes has to be parsed, which makes your concatenating with it puzzling, while single quotes are not parsed and simply interpreted as is.

These are drops in the bucket sure, saving microseconds. These things add up however, and you should always aim for good code.
Reply
#35
Did you disable template comments in your settings? It's a default MyBB setting under "Server and Optimization Options" labeled "Output template start/end comments?".

Plugins works perfectly fine without your edits.
Reply
#36
(May 23, 2012, 02:27 AM)labrocca Wrote: Did you disable template comments in your settings? It's a default MyBB setting under "Server and Optimization Options" labeled "Output template start/end comments?".

Plugins works perfectly fine without your edits.

It is disabled, if the plugin relies so heavily on that you should mention it somewhere. And honestly it'd be better to be running off unique tokens rather than the built in template comments; Would perform the exact same and have better compatibility. Not like it's hard to implement, couple extra lines of code to insert the tokens into templates.

"Works perfectly fine" is one thing, doesn't mean it's well made.
Reply
#37
Thanks for this Labrocca, couldn't get my other ad plugins to work correctly, great plugin Smile
Reply
#38
Just installed!
This plugin is works properly on latest MyBB 1.6.8 (with or without Output template start/end comments activated) Wink

I am thinking of idea about adding function displaying banner once at that day (by click close button/else). But tomorrow, it shows up again Smile
Maybe javascript reading cookies is the solution to reduce query..
Reply
#39
Thanks Labrocca! It's working all fine!
Reply
#40
Just what i was looking for thank you so much
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)