Jump to content
TNG Community
Sign in to follow this  
dvfreeman

Delete Source & Google Link Stays Active (Solved)

Recommended Posts

dvfreeman

When you delete a person from TNG, the person’s ID is deleted. If Google had a link to that person, following the link will then result in a 404 error (no page exists). Once a link results in a 404 error, you can request Google delete the link or just wait for the robots to delete it as a result of their routine site scans. But, it will be deleted.

However, when you delete a source from TNG, the source information is deleted but the ID is not. If Google has a link to that source, following the link will then result in a TNG source page with the ID but no information. It will not result in a 404 error. Since the link sees something, the Google link will remain active until such time that the source ID is used for something else and the robots pick up the change.

In some cases, you may find that the existence of such a false source link (i.e., the link’s description on Google) is unacceptable. In such cases, Darrin suggest the following code be added to insure a 404 error is produced when a TNG source has been deleted.

In showsource.php, after the lines that begin with:

$query = "SELECT sourceID …..

$result = mysql_query($query) …..

The following code should be inserted:

if( !mysql_num_rows($result) ) {

mysql_free_result($result);

header( "Location: thispagedoesnotexist.html" ); }

Dave Freeman

Richland, WA

http://www.rootsandrelatives.net

Share this post


Link to post
Share on other sites
Rush

Good idea adding that to the showsource.php also.

There's been a little bit of discussion about 404 pages over on this thread too.

Rush

Share this post


Link to post
Share on other sites
Ken Roy

Good idea adding that to the showsource.php also.

There's been a little bit of discussion about 404 pages over on this thread too.

Rush

The following are the changes to make the mod that Rush developed for getperson work in TNG 7.0 for showsource.php

Replace line 30 in showsource.php

header( "Location: thispagedoesnotexist.html" );
with the following code
//    header( "Location: thispagedoesnotexist.html" );  replaced with custom 404 page Ken Roy
    header("HTTP/1.0 404 Not Found");
    echo "<center>";
    echo "<font size=\"5\" face=\"Verdana\"> <b>$text[sorry]</b>";
    echo "<font size=\"3\" face=\"Verdana\">";
    echo "<br /><br />$text[sourcepagemoved]<br />";
    echo "<br />$text[pleaseuse] <a href=$tngdomain/browsesources.php>$text[browseallsources]</a> $text[tolocatesource]";
    echo "</font>";
    echo "</center>"; // see TNG Forum Entry http://www.tngforum.us/index.php?s=&showtopic=2186&view=findpost&p=9701 Rush/Ken Roy
Note that the $text changes requires the $text for the getperson.php mod Changes to English/cust_text.php
// Added for Person Not Found message in getperson.php 404 error message
$text[sorry] = "Sorry!";
$text[pleaseuse] = "Please use the ";
// Added for Source Not Found message in showsource.php 404 error message
$text[sourcepagemoved] = "The page for the source you were looking for may have moved,";
$text[tolocatesource] = " feature to locate the source page.";
Changes to French/cust_text.php
// Added for Person Not Found message in getperson.php 404 error message
$text[sorry] = "Désolé!";
$text[pleaseuse] = "Veuillez employer la forme de ";
// Added for Source Not Found message in showsource.php 404 error message
$text[sourcepagemoved] = "La page pour la source que vous cherchez peut-être déplacée,";
$text[tolocatesource] = " pour localiser la source.";

You may want to use this mod if you decide to use the Re-sequencing IDs feature in TNG 7.0 to re-sequence Sources.

See also TNG Wiki Message 404 - showsource Mod

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×