Author |
Message |
storebuilder
PHP-Portal Project

Joined: Mar 09, 2004
Posts: 169
Location: Telford UK
|
Posted:
Tue Sep 14, 2004 6:54 am |
|
A major part of website promotion is link exchanging and as more and more automated software is used to detect links I have a hit a major problem.
The current web links module uses a redirect for the link - so link exchange software can not detect the link.
Is there any way I can remove the redirect without breaking the whole module or should I just replace the links module with a standard engine?
Many thanks in advance. |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Sep 14, 2004 7:23 am |
|
I don't use this module so can you detail what you mean? What is happening as compared to what you need to happen? |
|
|
|
 |
storebuilder

|
Posted:
Tue Sep 14, 2004 7:27 am |
|
Here's the email I just got from a potential link partner:
Quote: |
The reason why this is the case is the link on the page
http://www.storebuilder.co.uk/link-13.html goes through a redirect before it
opens our website.
When selecting link partners we look at all aspects of the link
including the benefit we receive from increased link popularity on the
Search Engine’s. The method your site uses to open our website will not be
recognised by the Search Engine’s as a link to our site.
Having reviewed your site we would happily exchange links with you
however we do require a direct link back.
|
You don't use a links module? Now's the time to start  |
|
|
|
 |
chatserv
Member Emeritus

Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico
|
Posted:
Tue Sep 14, 2004 8:07 am |
|
Try changing your visit function to:
Code:function visit($lid) {
global $prefix, $db;
include("header.php");
menu(1);
$lid = intval($lid);
$db->sql_query("update ".$prefix."_links_links set hits=hits+1 where lid='$lid'");
update_points(14);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, url from ".$prefix."_links_links where lid='$lid'"));
$title = stripslashes($row['title']);
$url = stripslashes($row['url']);
OpenTable();
echo "<center>Click <a href=\"$url\" target=\"_blank\">here</a> to visit ".$title."</center>";
CloseTable();
include("footer.php");
}
|
|
Last edited by chatserv on Tue Sep 14, 2004 2:21 pm; edited 1 time in total |
|
|
 |
storebuilder

|
Posted:
Tue Sep 14, 2004 12:34 pm |
|
Thanks Chatserv.
I removed the "update points" line which must be for a later version and it works a charm!
Fantastic! Thanks. |
|
|
|
 |
storebuilder

|
Posted:
Sun Sep 19, 2004 11:04 am |
|
How do I go about "extending" the life of a "new" graphic.
I have graphics which go red, blue green - I'd like to extend the number of days that each respective graphic is active.
I see all of the options in the config file and I looked in the index.php file for this module but I don't see where to count the number of days that each graphic is active.
Being as my site is not so busy at the moment I'd like to extend the number of days for a " new" site.
Thanks
Tony |
|
|
|
 |
Raven

|
Posted:
Sun Sep 19, 2004 11:15 am |
|
This function is what you want to modifyCode:function newlinkgraphic($datetime, $time) {
global $module_name;
echo " ";
setlocale (LC_TIME, $locale);
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
$datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
$datetime = ucfirst($datetime);
$startdate = time();
$count = 0;
while ($count <= 7) {
$daysold = date("d-M-Y", $startdate);
if ("$daysold" == "$datetime") {
if ($count<=1) {
echo "<img src=\"modules/$module_name/images/newred.gif\" alt=\""._NEWTODAY."\">";
}
if ($count<=3 && $count>1) {
echo "<img src=\"modules/$module_name/images/newgreen.gif\" alt=\""._NEWLAST3DAYS."\">";
}
if ($count<=7 && $count>3) {
echo "<img src=\"modules/$module_name/images/newblue.gif\" alt=\""._NEWTHISWEEK."\">";
}
}
$count++;
$startdate = (time()-(86400 * $count));
}
}
| Modify the 'if ($count<=' settings to your desires. |
|
|
|
 |
storebuilder

|
Posted:
Sun Sep 19, 2004 11:48 am |
|
Thanks Raven, Yes I see it all now. Thankyou. |
|
|
|
 |
storebuilder

|
Posted:
Sun Sep 19, 2004 12:22 pm |
|
Well - I see it, but it's not so straightforward. LOL.
Let me see.... |
|
|
|
 |
storebuilder

|
Posted:
Sun Sep 19, 2004 12:26 pm |
|
Ok - If I alter this:
$daysold = date("d-M-Y", $startdate);
if ("$daysold" == "$datetime") {
if ($count<=1) {
echo "<img src=\"modules/$module_name/images/newred.gif\" alt=\""._NEWTODAY."\">";
}
if ($count<=3 && $count>1) {
echo "<img src=\"modules/$module_name/images/newgreen.gif\" alt=\""._NEWLAST3DAYS."\">";
}
if ($count<=7 && $count>3) {
echo "<img src=\"modules/$module_name/images/newblue.gif\" alt=\""._NEWTHISWEEK."\">";
}
}
Then I get it:
Thanks Raven: And it's about time you used links because.... |
|
|
|
 |
Raven

|
Posted:
Sun Sep 19, 2004 1:20 pm |
|
You also have to modify this line while ($count <= 7) {. The '7' has to match your value in the last 'if' statement. |
|
|
|
 |
storebuilder

|
Posted:
Fri Sep 24, 2004 8:28 am |
|
|
|
 |
Raven

|
Posted:
Fri Sep 24, 2004 8:47 am |
|
How about a hint as to what's wrong ? |
|
|
|
 |
storebuilder

|
Posted:
Fri Sep 24, 2004 9:17 am |
|
Oh not again!
Well - on my display, the links categories are not displaying correctly because the left hand column of the table appears narrower than the right hand side. I've also noticed that sometimes when I add a category it corrects itself. |
|
|
|
 |
Raven

|
Posted:
Fri Sep 24, 2004 9:25 am |
|
|
|
 |
storebuilder

|
Posted:
Fri Sep 24, 2004 9:29 am |
|
When I read your post I was beginning to think I was bcoming a complete idiot - but thankfully your image quite clearly shows what I mean - the left hand column is much narrower than the right hand column and it's not balanced. |
|
|
|
 |
Raven

|
Posted:
Fri Sep 24, 2004 9:34 am |
|
I see now. Just find that table and make each <td width="50%"> |
|
|
|
 |
storebuilder

|
Posted:
Fri Sep 24, 2004 10:23 am |
|
Yes - but the code doesn't read like that. (I doesn't for me anyway )
Quote: |
echo "<br>";
OpenTable();
echo "<center><font class=\"title\"><b>"._LINKSMAINCAT."</b></font></center><br>";
echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>";
$result = sql_query("select cid, title, cdescription from ".$prefix."_links_categories where parentid='0' order by title", $dbi);
$count = 0;
while(list($cid, $title, $cdescription) = sql_fetch_row($result, $dbi)) {
$cid = intval($cid);
echo "<td><font class=\"option\"><strong><big>·</big></strong> <a href=\"modules.php?name=Web_Links&l_op=viewlink&cid=$cid\"><b>$title</b></a></font>";
categorynewlinkgraphic($cid);
if ($cdescription) {
echo "<br><font class=\"content\">$cdescription</font><br>";
} else {
echo "<br>";
}
|
It doesn't seem to specify how the tables are laid out? |
|
|
|
 |
Raven

|
Posted:
Fri Sep 24, 2004 10:35 am |
|
Try changingCode:echo "<td><font class=\"option\"><strong><big>·</big></strong>
| toCode:echo "<td width=\"50%\"><font class=\"option\"><strong><big>·</big></strong>
|
|
|
|
|
 |
storebuilder

|
Posted:
Fri Sep 24, 2004 10:56 am |
|
Oooohhh YES! That hits the spot  |
|
|
|
 |
dssripper
Regular


Joined: Feb 16, 2004
Posts: 69
|
Posted:
Mon Oct 18, 2004 3:30 pm |
|
chatserv wrote: | Try changing your visit function to:
Code:function visit($lid) {
global $prefix, $db;
include("header.php");
menu(1);
$lid = intval($lid);
$db->sql_query("update ".$prefix."_links_links set hits=hits+1 where lid='$lid'");
update_points(14);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, url from ".$prefix."_links_links where lid='$lid'"));
$title = stripslashes($row['title']);
$url = stripslashes($row['url']);
OpenTable();
echo "<center>Click <a href=\"$url\" target=\"_blank\">here</a> to visit ".$title."</center>";
CloseTable();
include("footer.php");
}
| |
chatserv,
I am trying to do the same thing as storebuilder.
I tried changing the code of my visit function to the
what you had posted, but it didn't work for me. It just
brought back a blank weblink module pages.
Here is my current code.
Code:function visit($lid) {
global $prefix, $dbi;
sql_query("update ".$prefix."_links_links set hits=hits+1 where lid=$lid", $dbi);
$result = sql_query("select url from ".$prefix."_links_links where lid=$lid", $dbi);
list($url) = sql_fetch_row($result, $dbi);
Header("Location: $url");
}
|
Thanks!
Dss |
|
|
|
 |
chatserv

|
Posted:
Mon Oct 18, 2004 3:47 pm |
|
Code:function visit($lid) {
global $prefix, $dbi;
include("header.php");
menu(1);
$lid = intval($lid);
sql_query("update ".$prefix."_links_links set hits=hits+1 where lid='$lid'", $dbi);
$result = sql_query("select url from ".$prefix."_links_links where lid='$lid'", $dbi);
list($url) = sql_fetch_row($result, $dbi);
OpenTable();
echo "<center>Click <a href=\"$url\" target=\"_blank\">here</a> to visit ".$url.".</center>";
CloseTable();
include("footer.php");
}
|
|
|
|
|
 |
dssripper

|
Posted:
Mon Oct 18, 2004 4:28 pm |
|
That worked... I think.
I am not sure if thats quite what I wanted. I thought it would link directly back to them
from the original web link. It still goes to a redirect and just displays the link.
Any way to have go directly to the link from the main link?
Thanks!!!
Dss |
|
|
|
 |
chatserv

|
Posted:
Mon Oct 18, 2004 4:41 pm |
|
What version of Nuke? Be aware that if a change is made so that it directs right to the site there might not be a way to have the hits count grow, that is the main purpose of the visit function. |
Last edited by chatserv on Mon Oct 18, 2004 5:26 pm; edited 1 time in total |
|
|
 |
dssripper

|
Posted:
Mon Oct 18, 2004 4:46 pm |
|
its phpnuke 6.9. So if I put a referral link, it wouldn't count the hits to it from there site?
Thanks!
Dss |
|
|
|
 |
|