[3.4.3] Link to Us ...
 
Notifications
Clear all

[3.4.3] Link to Us Block

12 Posts
6 Users
0 Reactions
7,202 Views
(@dreamhowler)
Posts: 147
Estimable Member
Topic starter
 

I really wanted to try this linktous block that you included in 3.4.3. However, it doesn't say what is supposed to go in the file promote.php and I need some help to set it up. I have a few images I can use. I just need to know how to install it properly.

Thanks for your help.

Dreamy


Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 04/06/2008 3:31 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

"linktous" block?

After looking at promote.php I just assumed images went into /buttons. The script runs through the directory and "displays" the images in that folder? (or, at least, the URL)


archive: dramione.org
site: accio.nu

Available for skin/mod commission! 🙂

 
Posted : 04/06/2008 4:27 pm
(@dreamhowler)
Posts: 147
Estimable Member
Topic starter
 

Well, when I look at everything, there is no promote.php.

All it says is: This block for eFiction 3.x adds a "Link to Us" block to the script that displays a random banner for your site inviting visitors to link to you.

This block requires some customization.  You'll need to open the linktous.php file and edit the section marked for configuration.

I opened the linktous.php and it shows buttons and a promote.php. It doesn't say weither the buttons directory is in the linktous directory, or the main directory, and it doesn't say what is supposed to be in the unincluded promote.php. That was why I was confused. I created the buttons directory in the main and the linktous directory, neither of them picked up anything.


Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 04/06/2008 6:00 pm
(@guest1448)
Posts: 0
 

This feature is unfinished, I asked about this in the 3.4.3 release thread.


 
Posted : 04/06/2008 6:53 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

Oh! I thought it was just promote.php that was in the eFic download... Sorry.


archive: dramione.org
site: accio.nu

Available for skin/mod commission! 🙂

 
Posted : 04/06/2008 6:55 pm
(@guest2396)
Posts: 0
 

Hi!

I had similar problem, so I think it's correct to post here.

I have the link to us block instaled and it appears in the web, but the images doesn't work.

Where do I need to put the images? Is there some existing place, or do I need to create it?

Can you help me? I'm a little lost with it


 
Posted : 09/02/2009 7:42 am
(@tammy)
Posts: 2577
Member Moderator
 

As already stated.  It wasn't supposed to be in the download.  It's something I'm working on for my site and haven't generalized.  It won't work.


 
Posted : 09/02/2009 3:18 pm
(@crimsonicegoddess)
Posts: 5
Active Member
 

Sorry to reactivate an old discussion, but I just wanted to say that I got this block to work. It took a little tweaking, but it's working fine on my site.

Here's the site so you can check it out. http://crystalinerose.com/index1.php


My portfolio: http://fatalred.com
Efiction Testing Area: http://fatalred.com/eFiction352/index.php

 
Posted : 21/08/2010 10:26 pm
(@dreamhowler)
Posts: 147
Estimable Member
Topic starter
 

Sorry to reactivate an old discussion, but I just wanted to say that I got this block to work. It took a little tweaking, but it's working fine on my site.

Here's the site so you can check it out. http://crystalinerose.com/index1.php

What did you do to tweak it? I am getting a 404 error on that url.


Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 13/09/2010 9:17 am
(@crimsonicegoddess)
Posts: 5
Active Member
 

Sorry to reactivate an old discussion, but I just wanted to say that I got this block to work. It took a little tweaking, but it's working fine on my site.

Here's the site so you can check it out. http://crystalinerose.com/index1.php

What did you do to tweak it? I am getting a 404 error on that url.

I moved my archive to a new destination. http://maturetwific.com. You can see a working 'demo?' of the block there.

It does take some tweaking to get it to work but it's not hard.

First and foremost, create a 'buttons' folder (put your images in this folder) in your main directory (wherever the main files for your efiction site are.) Then rather than create a promote.php file, I simply created a custom page and called it promote. (viewpage.php?page=promote) Once that's done you'll need to go to your 'blocks' folder and open the 'linktous' file. Open 'linktous.php'.

Find this:

$codepage = _BASEDIR."promote.php";

Replace it with this:

$codepage = _BASEDIR."viewpage.php?page=promote";

Lastly, you'll see a list that looks like this:

$images[] = "88x31-A.jpg";
$images[] = "88x31-B.jpg";
$images[] = "88x31-C.jpg";
$images[] = "88x31-D.jpg";
$images[] = "88x31-E.jpg";
$images[] = "88x31-F.jpg";
$images[] = "88x31-G.jpg";
$images[] = "88x31-H.jpg";
$images[] = "88x31-I.jpg";
$images[] = "88x31-J.jpg";
$images[] = "88x31-K.jpg";
$images[] = "88x31-L.jpg";
$images[] = "88x31-M.jpg";
$images[] = "88x31-N.jpg";
$images[] = "88x31-O.jpg";
$images[] = "100x35-A.jpg";
$images[] = "100x35-B.jpg";
$images[] = "100x35-C.jpg";
$images[] = "100x35-D.jpg";
$images[] = "100x35-E.jpg";
$images[] = "100x35-F.jpg";
$images[] = "100x35-G.jpg";

Replace text in between the quotes with the title of your image. Example: "mtaimage.gif" or whatever your image file is. Make sure you activate the block in your admin area under 'Blocks' and if you have to you, you may need to code it into whatever skin you're using. This would depend on the skin you're using, (for me this block is displayed in my index.tpl file) but you'll need to open the .tpl file where your block is displayed. This file is in the skin folder of whatever skin you're using.

Simply open it up and add this:

 <div class="block">
      <div class="title">{linktous_title}</div>
      <div class="content">{linktous_content}</div>
    </div>

Most skins have a list of blocks to be shown by default so you should be able to just paste this under one of those other blocks (siteinfo, online, etc). Upload the entire linktous folder to your server, and replace your .tpl file (index or whatever) with the altered .tpl that you set to display the block.

That's all you have to do. If you want, since you've created a custom page, you can place as many different link images on as you want. And whenever the user clicks the link at the bottom of the block, it will take them to the page so they can see the other images and use one of those.

Right now, my link is a dummy link. This is because I moved servers and never recreated the promote page. But the block still works for me.

Hope this was helpful. Obviously, if there's an easier way to do this I'd love to hear it. This is just what i did to configure the block to work for me.


My portfolio: http://fatalred.com
Efiction Testing Area: http://fatalred.com/eFiction352/index.php

 
Posted : 21/09/2010 12:45 pm
(@tammy)
Posts: 2577
Member Moderator
 

Since so many want to try this, here's the text of promote.php I'm using on my site.  No support on this.  I haven't looked at it in over a year.


<?php
// ----------------------------------------------------------------------
// Copyright (c) 2007 by Tammy Keefer
// Based on eFiction 1.1
// Copyright (C) 2003 by Rebecca Smallwood.
// http://efiction.sourceforge.net/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------

$current = $_GET['page'];

include ("header.php");

//make a new TemplatePower object

if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
else $tpl = new TemplatePower("default_tpls/default.tpl");
//let TemplatePower do its thing, parsing etc.

include("includes/pagesetup.php");

$directory = opendir(_BASEDIR."buttons");
$validTypes = array("jpg", "gif", "png");

while($filename = readdir($directory)) {
if($filename== "." || $filename== "..") continue;
$parts = explode(".", $filename);
if(!in_array($parts[1], $validTypes)) continue;
$images[] = $filename;
}
closedir($directory);
sort($images);
$text = "
<script language='javascript' type='text/javascript'>
var images = new Array( );
var current = 0;
var url = '$url';
var sitename = '$sitename';
";
foreach($images AS $k => $i) {
$text .= "images[$k] = '$i';";
}
$text .= "
function imageSwitch(dir) {
img = document.getElementById('currentImage');
code = document.getElementById('imgCode');
current = current + dir;
if(images.length <= current) current = 0;
if(current < 0) current = images.length - 1;
newImage = new Image() ;
newImage.src = 'buttons/' + images[current];
img.src = 'buttons/' + images[current];
// remove the old code first.
while(code.firstChild) {
code.removeChild(code.firstChild);
}
text = document.createTextNode("<a href="'"" + url + "'><img src="'"" + url + "/buttons/" + images[current] + "' alt='" + sitename + "'></a>");
code.appendChild(text);
return false;
}
</script>
";

$text .= "<div id='imgContainer' style='text-align: center; margin: 1em;'><img id='currentImage' src="'buttons/".$images[0"]."'>";
$text .= "<div id='imgControls' style='text-align: center; margin: 1em;'><a href="'#'" onClick='imageSwitch(-1); return false;'>"._PREVIOUS."</a> | <a href="'#'" onClick='imageSwitch(+1); return false;'>"._NEXT."</a></div>";
$text .= "<div id='imgCode' style='border: 1px solid #222; margin: 0 10%; padding: 1ex;'>&lt;a href="'$url'&gt;&lt;img" src="'$url/buttons/".$images[0"]."' alt='$sitename'&gt;&lt;/a&gt;</div></div>";

$text .= "<div style='display:none;'>";
foreach($images AS $i) {
$text .= "<img src="'buttons/$i'" alt='$sitename'>";
}
$text .= "</div>";

$tpl->assign("output", "<div id='pagetitle'>Buttons and Banners</div>nn
<p style='padding: 1em;'>Please help us promote Wormhole Crossing by linking to us.  You may direct link to these images using the code provided below the image.  The code is updated each time the image changes.</p>$text");
$tpl->printToScreen();
dbclose( );
?>

 
Posted : 21/09/2010 7:31 pm
(@izdoodle)
Posts: 101
Estimable Member
 

Sorry to reactivate an old discussion, but I just wanted to say that I got this block to work. It took a little tweaking, but it's working fine on my site.

Here's the site so you can check it out. http://crystalinerose.com/index1.php

When I went to get your affiliate button the other day, I noticed you had it activated and started to ask you how you got it to work. I know our affiliates pages are similar but I liked how you had your buttons listed on a separate page with the codes. It definitely makes it a lot easier to do an affiliates page that way and also not having to email codes out for those who aren't familiar with how to create an HTML banner and link.
Thanks for your info. I might try to add this to TwiWrite eventually. I think this is a most awesome block to have for those of use who affiliate with a lot of other sites. I just pray I can follow your steps easily enough. Goodness knows I have a knack for messing stuff up all over the place. lol


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 28/11/2010 1:24 am
Share: