Warning: preg_replace_callback(): Requires argument 2, '$func['entity_fix']('\2')', to be a valid callback in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3

Warning: preg_replace_callback(): Requires argument 2, '$func['entity_fix']('\2')', to be a valid callback in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Print Page - Banner Exchange v0.0.4

DragonPrime - LoGD Resource Community

Modules, Themes and other customizations for your game => Completed Modules for version 1.x.x => Topic started by: MarcTheSlayer on May 27, 2009, 12:22:55 PM



Title: Banner Exchange v0.0.4
Post by: MarcTheSlayer on May 27, 2009, 12:22:55 PM
Banner Exchange v0.0.4

I couldn't find one suitable so wrote this with ideas from "Link Exchange" by Rolland and "External Links" by JT Traub. :)

You get a banner editor in the Grotto where you can add links with or without banners/description. You can have them appear on a separate page linked from home.php (ideal for banners and descriptions) or just have the links appear as nav links, or both.

There's also a page for your own details so people can add your site to their own exchange page if they so choose.

Settings to set a maximum width size to override that of the banners should you wish to do so. To randomise the banners. To randomly place one at the bottom of home.php.

No limit on how many banners you can add.


Updates:
15/06/09 - v0.0.2
+ Links on the 'home' page now open in a new window.
04/09/10 - v0.0.3
+ Fixed a problem with deleting banners.
+ Fixed some formatting problems.
07/05/11 - v0.0.4
+ Fixed issue with htmlentities.


Feedback, questions, bugs welcome. :)

Zip file attached.


Title: Re: Banner Exchange v0.0.1
Post by: fullmetalalki on May 27, 2009, 04:49:53 PM
this sounds like a great release, nice work :D


Title: Re: Banner Exchange v0.0.1
Post by: Stephen Kise on September 30, 2009, 07:41:15 PM
This is sone great work Afkamm. Good job :)


Title: Re: Banner Exchange v0.0.1
Post by: JollyGG on September 30, 2009, 11:14:43 PM
/me is addicted to Afkamm's modules and hits the Download button :P


Title: Re: Banner Exchange v0.0.4
Post by: Aeolus on May 19, 2012, 12:25:55 PM
Sorry for raising an old topic.. Any idea as to how I could modify this module so that the nav appears in the Shades and Village just like the Link Exchange (http://dragonprime.net/index.php?topic=7680.0) module? :)


Title: Re: Banner Exchange v0.0.4
Post by: ShadowRaven on May 19, 2012, 01:11:44 PM
Just add the hooks for the village and shades, then add the cases in the run function.

Code:
module_addhook("village");
        module_addhook("shades");

then

Code:
switch( $hookname )
        {       
                case "village":
                case "shades":
                case "footer-home": blah blah blah


Title: Re: Banner Exchange v0.0.4
Post by: Aeolus on May 19, 2012, 07:53:32 PM
Just add the hooks for the village and shades, then add the cases in the run function.

How, then, do I return to the correct page (village, shades or home) from the Link Exchange?


Title: Re: Banner Exchange v0.0.4
Post by: ShadowRaven on May 20, 2012, 08:50:28 AM
Code:
villagenav();

or more specifically, something like,
Code:
if (!$session_user[loggedin]){
                addnav('Homepage');
                addnav('Login Page','home.php');
}else{
villagenav();


Title: Re: Banner Exchange v0.0.4
Post by: Aeolus on May 20, 2012, 05:23:47 PM
And the shades?


Title: Re: Banner Exchange v0.0.4
Post by: Brendan on May 20, 2012, 05:55:40 PM
Villagenav will take them to the shades if there dead.


Title: Re: Banner Exchange v0.0.4
Post by: Aeolus on May 20, 2012, 06:00:13 PM
Villagenav will take them to the shades if there dead.

Ahh, alright, thanks. Only problem is, I added in ShadowRaven's code.. And the villagenav ain't showin'. o.o


Title: Re: Banner Exchange v0.0.4
Post by: Brendan on May 20, 2012, 06:09:50 PM
Villagenav will take them to the shades if there dead.

Ahh, alright, thanks. Only problem is, I added in ShadowRaven's code.. And the villagenav ain't showin'. o.o

Code:
<?php
//install

module_addhook("village");
module_addhook("shades");

//dohook
switch ($hookname){
                case: 
"village";
                
//add the link
                
break;
                case: 
"shades";
                
//add the link
                
break;
}

//run
if (!$session['user']['loggedin']){
                
addnav('Homepage');
                
addnav('Login Page','home.php');
}else{
villagenav();
}










Title: Re: Banner Exchange v0.0.4
Post by: Megan|SaraBeth on May 20, 2012, 07:56:06 PM
Find this code at the bottom of the file:

Code:
if( get_module_setting('showdetails') == 1 )
{
addnav('Options');
addnav('Link To Us','runmodule.php?module=banner_exchange&op=linkus');

Change it to this code:

Code:
if( get_module_setting('showdetails') == 1 )
{
addnav('Options');
addnav('Link To Us','runmodule.php?module=banner_exchange&op=linkus');
                        villagenav();

Then above case 'footer-home': add the following code:

Code:
                        case 'village':
addnav(get_module_setting('homenav'));
if( ($homelink = get_module_setting('homelink')) != FALSE )
{
addnav(array('%s',$homelink),'runmodule.php?module=banner_exchange');
}
elseif( get_module_setting('showdetails') == 1 )
{
addnav('Link To Us','runmodule.php?module=banner_exchange&op=linkus');
}

$banners = banner_exchange_allprefs();
foreach( $banners as $key => $value )
{
if( $value['show'] == 1 && !empty($value['bannerurl']) )
{
}
if( $value['navlink'] == 1 )
{
addnav(array('%s',$value['sitename']), $value['siteurl'], FALSE, TRUE, '');
}
}

break;

                        case 'shades':
addnav(get_module_setting('homenav'));
if( ($homelink = get_module_setting('homelink')) != FALSE )
{
addnav(array('%s',$homelink),'runmodule.php?module=banner_exchange');
}
elseif( get_module_setting('showdetails') == 1 )
{
addnav('Link To Us','runmodule.php?module=banner_exchange&op=linkus');
}

$banners = banner_exchange_allprefs();
foreach( $banners as $key => $value )
{
if( $value['show'] == 1 && !empty($value['bannerurl']) )
{
}
if( $value['navlink'] == 1 )
{
addnav(array('%s',$value['sitename']), $value['siteurl'], FALSE, TRUE, '');
}
}

break;


Title: Re: Banner Exchange v0.0.4
Post by: Aeolus on May 20, 2012, 11:05:05 PM
Here we go, for those that want it. Same module, with links in the Village and Shades. If, of course, Afkamm doesn't mind me editing his module ;D


Title: Re: Banner Exchange v0.0.4
Post by: MarcTheSlayer on May 21, 2012, 11:01:18 AM
All public and free my friend, modify to your hearts content. :D

© 2019 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines