DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • November 20, 2018, 09:37:57 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Banner Exchange v0.0.4  (Read 9518 times)
0 Members and 1 Guest are viewing this topic.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1747


View Profile
« 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. Smiley

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. Smiley

Zip file attached.
« Last Edit: May 07, 2011, 07:46:17 AM by Afkamm » Logged

Check My Modules for the latest versions.
fullmetalalki
Militia
**
Offline Offline

Posts: 44



View Profile WWW
« Reply #1 on: May 27, 2009, 04:49:53 PM »

this sounds like a great release, nice work Cheesy
Logged

Stephen Kise
Codemeister
****
Offline Offline

Posts: 372



View Profile WWW
« Reply #2 on: September 30, 2009, 07:41:15 PM »

This is sone great work Afkamm. Good job Smiley
Logged
JollyGG
Mod God
*****
Offline Offline

Posts: 607


Jolly Good!


View Profile WWW
« Reply #3 on: September 30, 2009, 11:14:43 PM »

* JollyGG is addicted to Afkamm's modules and hits the Download button Tongue
Logged

Senior Staff Coder to: RPGLink
Supporter of: Forbidden Realm and LotGD4Adults2.
Released Modules: Here
Aeolus
Mod God
*****
Offline Offline

Posts: 1906


You're welcome.


View Profile WWW
« Reply #4 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 module? Smiley
Logged

ShadowRaven
Mod God
*****
Offline Offline

Posts: 805


Silence is a virtue...


View Profile WWW
« Reply #5 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
Logged

Aeolus
Mod God
*****
Offline Offline

Posts: 1906


You're welcome.


View Profile WWW
« Reply #6 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?
Logged

ShadowRaven
Mod God
*****
Offline Offline

Posts: 805


Silence is a virtue...


View Profile WWW
« Reply #7 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();
« Last Edit: May 20, 2012, 08:55:36 AM by ShadowRaven » Logged

Aeolus
Mod God
*****
Offline Offline

Posts: 1906


You're welcome.


View Profile WWW
« Reply #8 on: May 20, 2012, 05:23:47 PM »

And the shades?
Logged

Brendan
I am Brendan.
Mod God
*****
Offline Offline

Posts: 873


View Profile
« Reply #9 on: May 20, 2012, 05:55:40 PM »

Villagenav will take them to the shades if there dead.
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1906


You're welcome.


View Profile WWW
« Reply #10 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
Logged

Brendan
I am Brendan.
Mod God
*****
Offline Offline

Posts: 873


View Profile
« Reply #11 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();
}








Logged
Megan|SaraBeth
Mod God
*****
Offline Offline

Posts: 1065



View Profile WWW
« Reply #12 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;
« Last Edit: May 20, 2012, 08:00:33 PM by Megan|SaraBeth » Logged

Aeolus
Mod God
*****
Offline Offline

Posts: 1906


You're welcome.


View Profile WWW
« Reply #13 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 Grin
Logged

MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1747


View Profile
« Reply #14 on: May 21, 2012, 11:01:18 AM »

All public and free my friend, modify to your hearts content. Cheesy
Logged

Check My Modules for the latest versions.
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
42 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search