Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Sun Jan 21, 2007 12:46 pm Reply with quote

As some of you know haveing the right words at the beginning and the end of your page makes all the difference in the world as far as SEO is concerned.

I have a generic version of this runnign on my site now but I want to zero it on in. So what i need to do is look at what page is being viewed and IF they are anon and once we know, I want to echo "XYZ" in the foorter.

I have it working to some extent now...


Code:



themefooter();
   
if ($username == "") {$username = "Anonymous";
   
   echo "<b>Whatever"
      . " <a href=\"account-new_user.html\">Register</a> for FREE "
      . "<br><br>"
      . " <a href=\"whatever"><center><b>Whatever</b></center></a><br><br>";

} // end anonymous only section

\
Way question is how can I figure out what page it is and change text or links to whateever I want.

I would assume I would use something like this.....from Dynamic title....



Code:



if($name=="This Page"){
    echo = "Whatever I want it to say here";

}



Would I string these together with if/else statements or just of bunch of if statements?

Thanks!

Dawg
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Sun Jan 21, 2007 4:30 pm Reply with quote

IF/else should work fine. You could even do a switch case
Code:


switch($name) {
  case "Page1":
     echo "whatever";
     break;
  case "Page2:
     echo "Whatever2";
     break;
}


I find switch makes more readable code, but if/else works fine .. esp if there are multiple conditions you want to use

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
Dawg







PostPosted: Sun Jan 21, 2007 6:39 pm Reply with quote

evaders99,
I have never used Switch and Case....


Code:
switch($name) { 

  case "Page1":
     echo "whatever";
     break;
  case "Page2:
     echo "Whatever2";
     break;
}


So if $name = page1 it will echo whatever?

i will go try it....brb
 
Dawg







PostPosted: Mon Jan 22, 2007 10:37 am Reply with quote

Here is what I wound up with....

In footer I used this....
Code:
cookiedecode($user);

$username = $cookie[1];


    if ($username == "") {$username = "Anonymous";
   echo "<b><u>$name</u></b>";


Then I went into navtap and used the same code....

Code:
    if ($username == "") {$username = "Anonymous";

    echo "<b><a href=\"account-new_user.html\">Register</a> for FREE to Use our Offshore Fishing Resources"
      . "<br><br>"
       . "<center><b><u>$name</u></b></center>";


What Iwould really like is to get hold of $newpagetitle coming out of Dynamic Titles.

I tried adding $newpagetitle to the globels then calling it with

Code:
global $user, $cookie, $db, $admin, $pagetitle, $name, $newpagetitle;

cookiedecode($user);
$username = $cookie[1];

$NT1bgcolor = "#000000"; // Table Row Background Color
$NT2bgcolor = "#000099"; // Table Cell Backgroun Color
$NTfontcolor = "#00FFFF"; // Font Color

// This section is sent to users who are not logged in.
    if ($username == "") {$username = "Anonymous";
    echo "<b><a href=\"account-new_user.html\">Register</a> for FREE to Use our Offshore Fishing Resources"
      . "<br><br>"
       . "<center><b><u>$newpagetitle</u></b></center>";


That did not work. Any idea how I can get hold of the $newpagetitle varible??

Thanks,

Dawg

I can hear the Music.....I just need to turn up the volume....
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Tue Jan 23, 2007 7:14 am Reply with quote

Not sure why you are not getting $newpagetitle out of DT, but try adding this line in your DT include file as such:

$newpagetitle = $sitename.' '.$dt_delim.' '.$dt_mod_name;
$_GLOBALS['dawg_newpagetitle'] = $newpagetitle;

Then, use that $_GLOBALS['dawg_newpagetitle'] in your footer code.

BTW, you could also use the following IF instead of looking at the cookie (which you have to be careful doing as you are not handling the data from the cookie in a secure manner):

if (!is_user($user)) { //then this means page is being viewed by anonymous


}

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Dawg







PostPosted: Tue Jan 23, 2007 4:13 pm Reply with quote

Thanks Guys....I got it working!!

and here is payback.....

The search engines LOVE for you to have your keywords at the top and bottom of your page. Here is how I did it....

Install Dynamic_Titles.....and Navtap (If you do not have Navtap....this same idea should work about anywhere on the site you put it.)

Customize as you see fit.....

Then open up Navtap and find this function

I GOT THE BLACK PAGE OF DEATH! No Posting for me.......


Thank You montego, evaders99 and the whole RN team!

Dawg
 
Dawg







PostPosted: Tue Jan 23, 2007 6:35 pm Reply with quote

Man...I thought for sure I had it solid........Sad

Set the title of the page.....use the same set of words at the start and ending of the page. It works.....

The problem now is that they are all have title tags around them so i wind up with 3 titles on the page. I have tried
Code:
echo strip_tags($newpagetitle);
but that dose not do it....Back to the books...I have to get this right!

Dawg
 
Dawg







PostPosted: Tue Jan 23, 2007 7:48 pm Reply with quote

I got her now....Anyone that wants this drop me a PM with yopur e-mail and I will shot you the files....

Dawg
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

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 ©