2
   

phpBB links with outbound.pl

 
 
Reply Sat 6 Nov, 2004 05:28 am
hi,

i've installed SEO 2.0.0.txt file and mod_rewrite 1.0.0.txt
successfully.

the only change was

Code:RewriteEngine On
rewriteBase /phpBB/
........


because i installed it in /phpBB

i´ve seen a phpBB in which all the links in the textbody and
the sig where replaced by an outbound.pl

example
Code:
http://www.pleasevisitemydomain.com

will be replaced by
Code:
http://www.forumurl.com/cgi-bin/outbound/outbound.pl?url=http://www.pleasevisitemydomain.com


so there will be no need to delete all the posted links
from those people looking for some good incoming
backlinks.

any idea where to make the changes.

regards

ps: spellcheck didn't find any mistakes so i hope
my post can be understood (bad german/english)Cool
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 11,010 • Replies: 12
No top replies

 
Craven de Kere
 
  1  
Reply Mon 8 Nov, 2004 11:13 pm
I will post code for this soon, bug me this weekend if I forget.
0 Replies
 
bugscout
 
  1  
Reply Fri 19 Nov, 2004 05:08 am
hi craven

is there any result about outbound.pl?


i´ve made some changes in viewtopic_body.tpl and viewforum_body.tpl

change

viewtopic_body.tpl
<a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a>

to

<h2><span class="maintitle" >{TOPIC_TITLE}</span></h2>

viewforum_body.tpl

change

<a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a>

to

<h2><span class="maintitle">{FORUM_NAME}</span></h2>

the links in viewforum and viewtopic only link to itself (no function for
user and searchengines) and the only-text should be stronger than the
linktext for the position in searchengines.

i´ve feeded my search engine commando with the forum and
can report the result after weekend.

now i´m working on the placement of some text like the description for
the forums on the startpage to the viewforum-site, because there are to
many links and less text to get a good position in searchengines.

regards
0 Replies
 
Craven de Kere
 
  1  
Reply Fri 19 Nov, 2004 01:02 pm
Heer si some example code, needs changing where appropriate. There is a small issue with certain urls and posting them with anchor text that I'll eventually resolve and release this as a mod, but this should get you started:

Code:in bbcode.php

find

$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\-]+\.[\w\-.\~]+(?:/[^ \"\t\n\r<]*)?)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);

replace with

$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#eis", "'\\1<a href=\"http://www.able2know.com/go/?a2kjump='.urlencode('\\2').'\" target=\"_blank\">\\2</a>'", $ret);
find

$ret = preg_replace("#(^|[\n ])([\w]+?://.*?[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);

replace with

$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#eis", "'\\1<a href=\"http://www.able2know.com/go/?a2kjump='.urlencode('http://\\2').'\" target=\"_blank\">\\2</a>'", $ret);

in bbcode.tpl

find

<!-- BEGIN url --><a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->

replace with

<!-- BEGIN url --><a href="http://www.able2know.com/go/index.php?link={URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->


The redirect page:

Code:<?php
/* By Craven de Kere @ www.able2know.com
* Usage: index?a2kjump=http://www.etc......
*
*/

if($a2kjump == "")
{
header("Location: http://www.able2know.com");
}
else
{

$url = $HTTP_GET_VARS['a2kjump'];
reset ($HTTP_GET_VARS);
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
if ($key!= "a2kjump")
$morevars = $morevars . "&" . $key . "=" . $val;
}

$a2kjump = $url . $morevars;

header("Location: $a2kjump");
}
?>


Then you robot.txt exclude the directory where the redirect script is.
0 Replies
 
bugscout
 
  1  
Reply Fri 19 Nov, 2004 01:41 pm
hi,

thanks a lot.

i´ve just made the change in bbcode.tpl myself

Code:<!-- BEGIN url --><a href="cgi-bin/outbound.pl?url={URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->


but they only match if the links are like
Code:[url=www.domain.tld]text[/url]

and do not change

Code:http://www.domain.tld


so i will try the changes in bbcode.php

regards
0 Replies
 
bugscout
 
  1  
Reply Fri 19 Nov, 2004 02:00 pm
just forgotten

outbound.pl

Code:#!/usr/bin/perl
#
#
# REDIR.PL 1.0 April 9, 1997
# Copyright (C) 1997 John Watson
# e-mail: john <email protected>
#
# -----About-----
# REDIR.PL is a simple little CGI script that will redirect browsers to
# a new URL. It can display a page telling the user they are about to be
# redirected as well as log the redirect. This can be useful for tracking
# clicks through a web site or just a nice way to say adios to folks
# leaving your site.
#
# The latest copy of this script and documentation can be obtained from
# http://www.watson-net.com/
#
# Parameters
# url:
# fully qualified URL to redirect the user to. the url must be
# fully qualified (http://...) in order to redirect to another server.
# this also allows you to redirect using different protocols (e.g.
# ftp://..., gopher://..., etc.).
# title:
# title of the new URL for display purposes.
#
# url and title can be passed via POST or GET.
#
# both arguments are optional. if url is blank, the user will
# be redirected to the root of the current server. if title is blank,
# it is set equal to url.
#
# Output
# Creates a web page with the REFRESH meta tag.
# Redirects the user to the new page after n seconds.
# Optionally displays a redirection message to the user.
# Optionally logs all redirects.
#
# Examples
# FORM:
# <form method="POST" action="/cgi-bin/redir.pl">
# <input type="image" value="redir.gif">
# <input type="hidden" name="url" value="protocol://path/file">
# <input type="hidden" name="title" value="URL Title">
# </form>
#
# ANCHOR:
# <a href="/cgi-bin/redir.pl?url=protocol://path/file&title=URL Title">URL Title</a>
#
# -----Distribution-----
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.



require 'ctime.pl';

use CGI;
$q = new CGI;

#
# DEFAULT VARIABLES SECTION
#
$log = 1; # 1 log, 0 no log
$logfile = 'redir.log';
$delay = 0; # delay in seconds. $delay=0, $output=0 work well together.
$output = 0; # 1 output, 0 no output
#
# END OF DEFAULT VARIABLES
#

# get the parameters from the form or url
$url = $q->param('url');
$title = $q->param('title');

# if $url is blank then set equal to root of current server
if ($url eq "") {
$url = 'http://'.$q->server_name().'/';
}

# if $title is blank then set equal to $url
if ($title eq "") {
$title = $url;
}

# print html header
header();

# if output requested, print body

if ($output eq 1) { body(); }

# print html footer
footer();

# if logging requested, add a log entry
if ($log) { addlog(); }

exit(0);

# the http-equiv line in the header actually does the redirect
sub header {
print $q->header;
print <<EOT;
<html>
<head>
<title>Redirect to $title</title>
<meta http-equiv="refresh" content="$delay; url=$url">
</head>

<body bgcolor="#ffffff">

EOT
}

sub body {

$url = 'http://'.$q->server_name().'/';

print <<EOT;

<h3 align=center>Automatische Weiterleitung</h3>

<h3 align=center>Gleich geht es weiter....</h3>

<p align=center><a href="$url">webmaster</a></p>

EOT
}

sub footer {
print <<EOT;

</body>
</html>

EOT
}

sub addlog {
# get localtime()
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);

# make all numbers in the date two digits
if ($sec < 10) { $sec = "0$sec"; }
if ($min < 10) { $min = "0$min"; }
if ($hour < 10) { $hour = "0$hour"; }
if ($mon++ < 10) { $mon = "0$mon"; }
if ($mday < 10) { $mday = "0$mday"; }

# get remote host dns name or ip address
$host = $q->remote_host();

# get ctime() and chop off trailing newline
chop($time = ctime(time));

# open the logfile for appending
open(o,">>$logfile");

# each print() below is an alternative log format. only one should
# ever be uncommented.
# print o "$host\t$mon/$mday/$year\t$hour:$min:$sec\t$url\n";
print o "$host\t$time\t$url\n";

# close the logfile
close(o);
}


ctime.pl


Code:#!/usr/bin/perl
# ctime.pl is a simple Perl emulation for the well known ctime(3C) function.
#
# Waldemar Kebsch, Federal Republic of Germany, November 1988
# [email protected]
# Modified March 1990, Feb 1991 to properly handle timezones
# $RCSfile: ctime.pl,v $$Revision: 4.0.1.1 $$Date: 92/06/08 13:38:06 $
# Marion Hakanson ([email protected])
# Oregon Graduate Institute of Science and Technology
#
# usage:
#
# #include <ctime.pl> # see the -P and -I option in perl.man
# $Date = &ctime(time);

CONFIG: {
package ctime;

@DoW = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
@MoY = ('Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec');
}

sub ctime {
package ctime;

local($time) = @_;
local($[) = 0;
local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);

# Determine what time zone is in effect.
# Use GMT if TZ is defined as null, local time if TZ undefined.
# There's no portable way to find the system default timezone.

$TZ = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'GMT' ) : '';
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
($TZ eq 'GMT') ? gmtime($time) : localtime($time);

# Hack to deal with 'PST8PDT' format of TZ
# Note that this can't deal with all the esoteric forms, but it
# does recognize the most common: [:]STDoff[DST[off][,rule]]

# There's a bug in Perl 4.036 for DOS, which prevents the {0,2} from working:
# $TZ =~ /^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,1})/) # works fine
# $TZ =~ /^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})/) # fails in Perl4 for DOS

# if($TZ=~/^([^:\d+\-,]{3,99})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,99})?/){
# This does the same thing, and works around the DOS Perl 4.036 bug:
if($TZ=~/^([^:\d+\-,]{3,99})([+-]?\d{1,2}(:\d{1,2})?(:\d{1,2})?)([^\d+\-,]{3,99})?/){
$TZ = $isdst ? $4 : $1;
}
$TZ .= ' ' unless $TZ eq '';

$year += ($year < 70) ? 2000 : 1900;
sprintf("%s %s %2d %2d:%02d:%02d %s%4d\n",
$DoW[$wday], $MoY[$mon], $mday, $hour, $min, $sec, $TZ, $year);
}
1;


this writes the outgoing users in redir.log and works fine

regards
0 Replies
 
bugscout
 
  1  
Reply Fri 19 Nov, 2004 05:55 pm
hi craven,

thank you for your help.
everything works fine.

i´ve put a link to the forum on the bottom of my page

Code:http://www.spam-report.de/


i think i will be back soon.

regards
0 Replies
 
bugscout
 
  1  
Reply Sat 20 Nov, 2004 07:37 am
hi,

next change, i disabled the categorie-link in index_body.tpl
there is no need for it, if someone runs a small forum like mine.

Code:<!-- BEGIN catrow -->
<tr>
<td class="catLeft" colspan="2" height="28"><b><font color=#333333 size=3>{catrow.CAT_DESC}</font></b></td>


quick and dirty with font-tag

regards
0 Replies
 
Craven de Kere
 
  1  
Reply Sat 20 Nov, 2004 06:33 pm
bugscout,

Test teh mix of my code and the outbound perl script you posted with compelx URLs using multiple variables (yahoo news uers can do this sometimes).

Test them with anchor text on teh forums, since I didn't urlencode them.

If it works, then I'll be closer to packaging it as a mod and adding it to an upcoming SEO mod update.
0 Replies
 
bugscout
 
  1  
Reply Wed 24 Nov, 2004 01:29 pm
hi craven,

i am using this script in my cms and have to replace & by %26 in complex urls


just looking for the place where U_INDEX is defined, because it leads always to index.php. that will split the pagerank, because
www.domain.tld and index.html or index.htm have the same
pr and index.php has a seperate one.

i don´t like to open all pages to change U_INDEX to ./

regards
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 24 Nov, 2004 01:33 pm
bugscout wrote:
i am using this script in my cms and have to replace & by %26 in complex urls


Hmm, users won't know to do this so it doesn't fix it here. I'll have to urlencode some more.

Quote:
just looking for the place where U_INDEX is defined


includes/page_header.php

Code:'U_INDEX' => append_sid('index.'.$phpEx),
0 Replies
 
bugscout
 
  1  
Reply Wed 24 Nov, 2004 02:14 pm
hi


it seems to me that phpBB makes these changes by itself
yahoo-links and links from my cms run in phpBB

regards
0 Replies
 
993ti
 
  1  
Reply Sun 2 Jan, 2005 03:56 am
Any idea when your mod is relesaed Craven?
I tried it but it doesn't work.
Also tried some different approaches but with no luck Sad

I did find this btw:
Code:###############################################
## Hack Title: Active Link Referrer Blocker
## Hack Version: 1.0.0
## Author: wd2004
##
## Description: This hack will block the referrer when a link
## is clicked by going through safeurl.de first.
## When ever a link is posted on the BB, it will
## automatically add the safeurl.de address to the
## link. The whole process is invisible since it is
## added to the main phpbb link processing functions.
## When you edit your post, the link will appear the
## same way as you posted it.
##
## Compatibility: Tested on 2.0.10 only
##
## Installation Level: Easy
## Installation Time: ~1 minute
##
## Files To Edit: 1
## includes/bbcode.php
##
## Included Files: 0
##
## Author Notes: After creating this hack, I have noticed that it was
## created already back in 2002. According to other users
## the previous version stopped working after phpBB 2.0.5.
## This version will work with 2.0.10 and maybe earlier. I
## would like to give credit to the original author of the
## first script "Safeurl Hack" by reimer. I would also like
## to give credit to safeurl.de for providing this great url
## protection service.
##
## Support: http://www.phpbbhacks.com/forums
## Copyright: ©2004 Active Link Referrer Blocker v1.0.0 - wd2004
##
###############################################
## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
## Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
## Intellectual Property is retained by the hack author(s) listed above.
###############################################

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]------------------------------------------
#

// We do URLs in several different ways..
$bbcode_tpl['url1'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);
$bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']);

$bbcode_tpl['url2'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);
$bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);

$bbcode_tpl['url3'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);
$bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']);

$bbcode_tpl['url4'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);

#
#-----[ REPLACE ]------------------------------------------
#

// We do URLs in several different ways..
$bbcode_tpl['url1'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']);
$bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']);

$bbcode_tpl['url2'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']);
$bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);

$bbcode_tpl['url3'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']);
$bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']);

$bbcode_tpl['url4'] = str_replace('{URL}', 'http://en.safeurl.de/?\\1', $bbcode_tpl['url']);
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);

#
#-----[ FIND ]------------------------------------------
#

// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);

// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);

#
#-----[ REPLACE ]------------------------------------------
#

// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"http://en.safeurl.de/?\\2\" target=\"_blank\">\\2</a>", $ret);

// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://en.safeurl.de/?\\2\" target=\"_blank\">\\2</a>", $ret);

#
#-----[ SAVE & CLOSE ALL FILES ]--------------------------
#
#End


Maybe this will help when it's edited a bit?
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » phpBB links with outbound.pl
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/19/2024 at 09:53:30