View Full Version : Mini Mods - Yilmaz - Random Images in Header vB5
yilmaz
11-04-2020, 10:00 PM
A simple api plug.
I uploaded it to review and try.
This could be improved.
Demo Video https://www.youtube.com/watch?v=0oyc8AaJ9GI
========================================
How to install: Installation video https://www.youtube.com/watch?v=wX2T2GXjaIk
========================================
Upload the content of "Yilmaz - Random Images in Header vB5" to your root.
that's all it.
enjoy..
========================================
How to uninstall:
========================================
1. Remove the package "yilmazrandomimg" that located in /core/packages/
2. Go to "Manage Products" in the admincp and delete the product named "Yilmaz - Random Images in Header vB5"
Please Mark as Installed if you use this. :)
Donations always appreciated (https://www.paypal.com/paypalme/yilmaztv/5). :up:
Pitman
11-05-2020, 11:20 AM
I've uploaded the files, imported the product and even saved the default settings to be sure... But I don't get any changes to the templates\styles that I can see right off hand.
How would I go about using the URL of the random image within a template?
Example URL:
http://www.example.com/core/packages/yilmazrandomimg/img/1.jpg
I need to be able to control exactly how it should be displayed.
Thank you for your help! :)
Pitman
11-05-2020, 11:46 AM
I see this in template.php;
$yilmazrandomimg_find = '<div class="toolbar">';
$yilmazrandomimg_replace = '<div style="display: table-caption;text-align: center;"><img src="core/packages/yilmazrandomimg/img/'.$randomnum.'.png" alt="Random image" /></div><div class="toolbar">';
$result['header'] = str_replace($yilmazrandomimg_find, $yilmazrandomimg_replace, $result['header']);
But when I view a page and check it's page source, the replacement of "<div class="toolbar">" isn't taking place... I still find the original "<div class="toolbar">" in the page source and there is no "<img src="core/packages/yilmazrandomimg/img/'" inside the page source at all...
If I can get that replacement to work, I can just modify that file to display it like I'm trying to do.
yilmaz
11-05-2020, 12:19 PM
I tested it from Version 5.4.5 to Version 5.6.4 it worked without any problems.
This code should be in the header template <div class="toolbar">
If it is not installed automatically, do manual installation if it is not.
Go to [Add/Import Product] the /core/packages/yilmazrandomimg/xml/product_yilmazrandomimg.xml file on your computer.
Installation vidoe https://www.youtube.com/watch?v=wX2T2GXjaIk
yilmaz
11-05-2020, 12:42 PM
I updated and added alternative option
https://vborg.vbsupport.ru/attachment.php?attachmentid=157923&d=1604597671
lange
05-16-2021, 12:30 PM
Not compatible with PHP 7.4.15 (5.6.4 PL1 fresh install)
As is, the logo disappears in all my styles under PHP 7.4.15
Warning: Use of undefined constant logo - assumed 'logo' (this will throw an Error in a future version of PHP) in .../packages/yilmazrandomimg/api/template.php on line 28 Warning: Use of undefined constant powered_by_vbulletin_title - assumed 'powered_by_vbulletin_title' (this will throw an Error in a future version of PHP) in .../packages/yilmazrandomimg/api/template.php on line 28
[16-May-2021 01:50:28 UTC] Warning: Use of undefined constant powered_by_vbulletin_title - assumed 'powered_by_vbulletin_title' (this will throw an Error in a future version of PHP) in /home/xxxxxx/public_html/xxxxxxx/core/packages/yilmazrandomimg/api/template.php on line 28
Fixed by myself on PHP 7.4.15.
SWCForum
07-09-2021, 07:45 PM
Is there a way to make the URL that clicking the banner leads to, change depending on the banner? (Or is there a different version of this mod that does this) as that would be infinitely useful for custom adverts
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.