Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9
Author Message
storebuilder
PHP-Portal Project



Joined: Mar 09, 2004
Posts: 169
Location: Telford UK

PostPosted: Tue Sep 14, 2004 6:54 am Reply with quote

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.
 
View user's profile Send private message Visit poster's website MSN Messenger
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Sep 14, 2004 7:23 am Reply with quote

I don't use this module so can you detail what you mean? What is happening as compared to what you need to happen?
 
View user's profile Send private message
storebuilder







PostPosted: Tue Sep 14, 2004 7:27 am Reply with quote

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 [ Only registered users can see links on this board! Get registered or login! ] 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 Wink
 
chatserv
Member Emeritus



Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Tue Sep 14, 2004 8:07 am Reply with quote

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 
View user's profile Send private message Visit poster's website
storebuilder







PostPosted: Tue Sep 14, 2004 12:34 pm Reply with quote

Thanks Chatserv.

I removed the "update points" line which must be for a later version and it works a charm!

Fantastic! Thanks.
 
storebuilder







PostPosted: Sun Sep 19, 2004 11:04 am Reply with quote

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







PostPosted: Sun Sep 19, 2004 11:15 am Reply with quote

This function is what you want to modify
Code:
function newlinkgraphic($datetime, $time) {

    global $module_name;
    echo "&nbsp;";
    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







PostPosted: Sun Sep 19, 2004 11:48 am Reply with quote

Thanks Raven, Yes I see it all now. Thankyou.
 
storebuilder







PostPosted: Sun Sep 19, 2004 12:22 pm Reply with quote

Well - I see it, but it's not so straightforward. LOL.

Let me see....
 
storebuilder







PostPosted: Sun Sep 19, 2004 12:26 pm Reply with quote

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







PostPosted: Sun Sep 19, 2004 1:20 pm Reply with quote

You also have to modify this line while ($count <= 7) {. The '7' has to match your value in the last 'if' statement.
 
storebuilder







PostPosted: Fri Sep 24, 2004 8:28 am Reply with quote

Would you know how to fix a wonky links module Sad
[ Only registered users can see links on this board! Get registered or login! ]
 
Raven







PostPosted: Fri Sep 24, 2004 8:47 am Reply with quote

How about a hint as to what's wrong Smile ?
 
storebuilder







PostPosted: Fri Sep 24, 2004 9:17 am Reply with quote

Oh not again! Embarassed

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







PostPosted: Fri Sep 24, 2004 9:25 am Reply with quote

Well, it all appears normal when I view it. [ Only registered users can see links on this board! Get registered or login! ]
 
storebuilder







PostPosted: Fri Sep 24, 2004 9:29 am Reply with quote

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







PostPosted: Fri Sep 24, 2004 9:34 am Reply with quote

I see now. Just find that table and make each <td width="50%">
 
storebuilder







PostPosted: Fri Sep 24, 2004 10:23 am Reply with quote

Yes - but the code doesn't read like that. (I doesn't for me anyway Wink)

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>&middot;</big></strong> <a href=\"modules.php?name=Web_Links&l_op=viewlink&amp;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







PostPosted: Fri Sep 24, 2004 10:35 am Reply with quote

Try changing
Code:
echo "<td><font class=\"option\"><strong><big>&middot;</big></strong>
to
Code:
echo "<td width=\"50%\"><font class=\"option\"><strong><big>&middot;</big></strong>
 
storebuilder







PostPosted: Fri Sep 24, 2004 10:56 am Reply with quote

Oooohhh YES! That hits the spot Cool
 
dssripper
Regular
Regular



Joined: Feb 16, 2004
Posts: 69

PostPosted: Mon Oct 18, 2004 3:30 pm Reply with quote

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
 
View user's profile Send private message
chatserv







PostPosted: Mon Oct 18, 2004 3:47 pm Reply with quote

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







PostPosted: Mon Oct 18, 2004 4:28 pm Reply with quote

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







PostPosted: Mon Oct 18, 2004 4:41 pm Reply with quote

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







PostPosted: Mon Oct 18, 2004 4:46 pm Reply with quote

its phpnuke 6.9. So if I put a referral link, it wouldn't count the hits to it from there site?
Thanks!


Dss
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©