News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Pretty URLs

Started by SMFHacks.com Team, January 31, 2007, 10:56:43 AM

Previous topic - Next topic

Dannii

QuoteThere are some things I find frustrating, like the URL retaining the original board name if it is moved to another board. That sort of thing just irritates me (other's, I'm sure, would dismiss it as unimportant, because, usually, it is unimportant); but that's the way I'm put together.
That's just the cache. If you clear the cache table, the topics will show the correct boards.

QuoteEldeka (or whatever your name is now ::)) - thanks. I don't suppose there is any practical way of generating permanent redirects? Also, what are your future plans for this mod in terms of functionality?
The code I suggested above should give permanent redirects.

Future plans... nothings set in stone yet ;)
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

SA™

sry but i havnt got time to read throw all the pages bit is this alright to use with smf arcade yet sry i should read throw the commentnts biut i havint got time at them momnet thanks again wdm2005
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Dannii

"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

SA™

thanks is ther a packeg yet as i prefer to install packeges lol its easyer hehe
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Dannii

"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

SA™

thanks do i download all them files and install them [dont have pretty urls installed at mo
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Dannii

Yep, you can either make your own zip file, or just upload them to a new directory in Packages.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

SA™

thanks ill see if i can sort it out thanks eldka
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

cru

hi eldacar, its working fine now in my forum. but it disabled this newsfader script which i previously used on a block in my TP.

<Script Type="text/javascript">

var delay = 4000; // Set delay between message change (in miliseconds)
var maxsteps=30; // Number of steps to take to change from start color to endcolor
var stepdelay=40; // Time in miliseconds of a single step

//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div align="center" style="font: normal 14px Arial; padding: 5px;">'; //set opening tag, such as font declarations
fcontent[0]="WELCOME<Br>TO<Br>DOGFINDER<Br>PHILIPPINES!!!<Br><Br>";
fcontent[1]="READ<Br>OUR<Br>FEATURES!<Br><a href='http://mydoggy.net/forum-news-and-announcements/be-the-alpha-male-of-this-site!/'>CLICK HERE!</a><Br>";
closetag='</div>';

var fwidth='150px'; //set scroller width
var fheight='100px'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

/// No Need To Edit Anything Below This Line ///

var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;

/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);

  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

if (ie4||DOM2)
  document.write('<div id="fscroller" style="border:0px solid black;width:'+fwidth+';height:'+fheight+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
</Script>


any idea how i can make this script work along with pretty urls?
it just shows a blank TP block after i installed pretty url. The reason why i prefer this over the smf newsfader is because the default smf newsfader takes up too much space.

TIA

ericmn

#929
DUDES, this thing just broke my forum. Doesn't it work with SMF 1.1.4? When i applied it through package manager, every test was succesfull and then after hittin the install button, everything went wrong. Now my site gives an error, something with unserialized something...GOSH, i should've made backups...Well, basically its my fault that i've been careless...

Error occured on index.php, line 78. I had tinyportal installed...

I guess i have to create new forum files now? My forum applications were pretty old though...i had been maintainin it for like 2,3 years...over 9000 members and god-knows-how-many posts and attachments...

Agh.. yes..mm i wasnt able uninstall the package. It doesn't show up in the "installed packages" list.
I would go for it and uninstall it manually if i knew how.
(See, my admin panel works fine with those errors printed on the top of the page)

Dannii

cru, does it work if you change <Script to <script ?

ericmn, let me guess, you have a lot of boards with quotes in them? This is a known problem with 0.7. Uninstall the mod, delete the database entries, then try with the files at
http://prettyurls.googlecode.com/svn/trunk/Base/
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Nao 尚

ericmm> Normally, SMF does an automatic backup of your board files in the Packages/Backup folder. Check it out.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

cru

Quotecru, does it work if you change <Script to <script ?

it worked!  :D :D :D :D :D

you're a whiz man, thanks!

Col

Quote from: ܝܠܕܟ on November 08, 2007, 09:36:22 PM
QuoteThere are some things I find frustrating, like the URL retaining the original board name if it is moved to another board. That sort of thing just irritates me (other's, I'm sure, would dismiss it as unimportant, because, usually, it is unimportant); but that's the way I'm put together.
That's just the cache. If you clear the cache table, the topics will show the correct boards.

Oh, right - I now understand, I think.

Quote from: ܝܠܕܟ on November 08, 2007, 09:36:22 PM
QuoteEldeka (or whatever your name is now ::)) - thanks. I don't suppose there is any practical way of generating permanent redirects? Also, what are your future plans for this mod in terms of functionality?
The code I suggested above should give permanent redirects.

Future plans... nothings set in stone yet ;)

Oh. So search engines will re-list each page that they have already listed with a Pretty URL for a standard SMF URL? The search engines will not list both URLs for the same page (big SEO no-no)? I do mean a PERMANENT redirect. I cannot code at all, so I cannot tell from reading your code what will happen.

Thanks.

Nao 尚

I think you're pretty safe in terms of permanent redirect, yes. Eldakar has been VERY cautious in making sure his code is as robust and smart as possible. I myself am still surprised at the beauty of some of his functions. Which is probably why I spend a month working on making the mod fit my own needs... I couldn't pass up the opportunity to use it :)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

ericmn

#935
Quote from: Nao 尚 on November 09, 2007, 05:36:03 AM
ericmm> Normally, SMF does an automatic backup of your board files in the Packages/Backup folder. Check it out.

Holy ******, AWESOME! This is the kinda thing that i love about SMF.

THANKS Nao, You've saved me a hella a lot of time!!!

Hey, what about the database entry changes??? Can anybody suggest anything on that?
Thanks

Dannii

#936
http://prettyurls.googlecode.com/svn/trunk/uninstall.php
Download that file and put it in the same place as SSI.php, then run it, and delete it afterwards! That will remove everything that pretty urls added. Normally you wouldn't want to do that, but you need to in this case before changing from 0.7 to 0.8.

QuoteOh. So search engines will re-list each page that they have already listed with a Pretty URL for a standard SMF URL? The search engines will not list both URLs for the same page (big SEO no-no)? I do mean a PERMANENT redirect. I cannot code at all, so I cannot tell from reading your code what will happen.
It will do a permanent redirect, if it redirects at all. I'm not 100% sure it will redirect (as I haven't tested it myself) but I think it will.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Dannii

#937
Okay I'm trying something new. I'll be making new snapshot packages and putting them on the downloads page. They won't be nightly or even weekly, just when I feel I've made some significant changes to the development version. Hopefully this is a lot easier than downloading the files off SVN yourself. These packages should be fairly stable, but they won't be feature complete or as bug free as the full official versions.

So the first one is up there which has the important single quotes fixes.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Col

Quote from: ܝܠܕܟ on November 09, 2007, 09:44:55 PM
http://prettyurls.googlecode.com/svn/trunk/uninstall.php
Download that file and put it in the same place as SSI.php, then run it, and delete it afterwards! That will remove everything that pretty urls added. Normally you wouldn't want to do that, but you need to in this case before changing from 0.7 to 0.8.

QuoteOh. So search engines will re-list each page that they have already listed with a Pretty URL for a standard SMF URL? The search engines will not list both URLs for the same page (big SEO no-no)? I do mean a PERMANENT redirect. I cannot code at all, so I cannot tell from reading your code what will happen.
It will do a permanent redirect, if it redirects at all. I'm not 100% sure it will redirect (as I haven't tested it myself) but I think it will.

Thanks. :)

distortedice

Quote from: ܝܠܕܟ on January 31, 2007, 09:58:27 PM
To install:
  • Download and install the base package from the mod site.
  • Using FTP, rename example.htaccess to .htaccess
  • Download the extension-none (and the TP-ext-none if you use TinyPortal) package from the Package List, or just from the site directly, and then install them.
    ....
Okay, I'm officially stumped!

I've downloaded it, installed the base files, no problems. No errors. All went smoothly and it said it was installed.

But where in the heck is example.htaccess? It's not in the root of my forum where my index.php is. I'm using a test forum with only one mod (Members Post Recount) and the default theme.

I tried moving to the third step, but that didn't do anything either. I've plored through this topic trying to find an explanation but to no avail, my URL's are still ugly :( I'm using PHP version 4.4.4 and MySQL version 4.1.22-standard in case that helps.

Hopefully someone can help :D

Advertisement: