vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Products & Extensions (https://vborg.vbsupport.ru/forumdisplay.php?f=258)
-   -   Mini Mods - Yilmaz - Random Images in Header vB5 (https://vborg.vbsupport.ru/showthread.php?t=328332)

yilmaz 11-04-2020 10:00 PM

Yilmaz - Random Images in Header vB5
 
1 Attachment(s)
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. :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:

Code:

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;

Code:

                    $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
Code:

<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/attachmen...3&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


All times are GMT. The time now is 02:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01652 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete