SimpleSEF 2.0 (SMF 1.1.x and SMF 2.0)

Started by SlammedDime, December 05, 2009, 10:08:40 PM

Previous topic - Next topic

Achilles.


- All donations will proceed to my Youth Foundation.

http://poseidondesigners.tk/ -- Affordable Website Designs // Banners & More!

dagod

I would like to have a startpage for my forum. Therefore i have a "start.php" and wrote in the .htaccess file "DirectoryIndex start.php".
Works quite fine.
Problem is, that simpleSEF rewrites the "http://forum.com/index.php" to "http://forum.com/" so everytime i try to reach the board-index i come to the startpage.
How can i handle this?

Bruno36

I get errors in my log
ligne 278

$buffer = preg_replace('~(' . preg_quote($txt['page_created']) . '.*?' . preg_quote($txt['queries']) . ')~', '\1<br />' . $txt['simplesef_adds'] . ' ' . $simpleSEF['execTime'] . $txt['seconds_with'] . $simpleSEF['query_count'] . $txt['queries'], $buffer);
Bruno36 the French
SMF 2.0.9

feline

you have translated the SimpleSEF text strings in the Modifications.english.php to your language?

Fel

Bruno36

thank you very much, the problem was indeed the translation
Bruno36 the French
SMF 2.0.9

SlammedDime

Quote from: kpac on May 24, 2010, 01:10:00 PM
Quote from: Achilles. on May 24, 2010, 10:32:24 AM
Yep, it does work... However, I've got a problem regarding the mod rewriting, it gives me this link: http://mywebsite.com/home//_4.0.html not mywebsite/general_discussions and the like.
This seems to be a problem with some kinds of server configs.

See my post here, which is of a similar problem.
http://www.simplemachines.org/community/index.php?topic=352351.msg2622401#msg2622401
I realized I never FTP'd to your site to take a look at this... If you still need some help with it, let me know and I can take a look...

Achillies - I'd need FTP access to your site and a link to your board to test it out and see what is happening.

Quote from: dagod on May 27, 2010, 07:06:16 AM
I would like to have a startpage for my forum. Therefore i have a "start.php" and wrote in the .htaccess file "DirectoryIndex start.php".
Works quite fine.
Problem is, that simpleSEF rewrites the "http://forum.com/index.php" to "http://forum.com/" so everytime i try to reach the board-index i come to the startpage.
How can i handle this?
There really isn't a way to handle this.  The way this mod rewrites urls, it depends on index.php being the DirectoryIndex that apache will use.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

#707
Quote from: Antes on May 19, 2010, 11:50:36 AM
Quote from: Antes on May 14, 2010, 04:33:15 PM
i want SimpleSEF use /smf/.htaccess , how can i do this ?

may i bump this ?

Thank you :)
Sorry, I don't understand what you're asking... can you clarify?

Quote from: (F.L.A.M.E.R) on May 23, 2010, 10:52:42 AM
Anything ?
I'm dumbfounded... You do not want to edit the x00.php file at all... it is formatted a specific way for a reason (and uploading it via FTP could easily cause it be become corrupted if NOT done using binary).

Quote from: truhe on May 24, 2010, 04:59:58 AM
Quote from: SlammedDime on May 12, 2010, 04:25:21 AM
I'll have test this to see what is causing it
Did you test it ? In my board the name is always replaced by the nick "Macy" which is the member with ID=1
Ok, figured this one out, will update in the next release... in the mean time you can apply this fix...

In Sources/SimpleSEF.php
Code (Find) Select
   // Gotta fix up some javascript laying around in the templates
   $extra_replacements = array(
      '/rand,' => '/rand=',
      $boardurl . '/topic/' => $scripturl . '?topic=',
      'var smf_scripturl = "' . $boardurl . '/' => 'var smf_scripturl = "' . $scripturl,
   );
   $buffer = str_replace(array_keys($extra_replacements), array_values($extra_replacements), $buffer);


Code (Replace) Select
   // Gotta fix up some javascript laying around in the templates
   $extra_replacements = array(
      '~/rand,~' => '/rand=',
      '~' . preg_quote($boardurl) . '/topic/~' => $scripturl . '?topic=',
      '~' . preg_quote('var smf_scripturl = "' . $boardurl) . '/~' => 'var smf_scripturl = "' . $scripturl,
      '~((?:to|bbc)Complete\.source.*?)/search/~' => '\\1/search,',
   );
   $buffer = preg_replace(array_keys($extra_replacements), array_values($extra_replacements), $buffer);
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

mirahalo

it seems simpleSEF does not work well with advance reputation system on RC3,  when a user give reputation the message to confirm does not appear then the reputation was never give.

no errors on error log, just the message wont appear


this are the two edits that advance reputation does to show the message when a usar gives reputation

./Themes/default/Xml.template.php

function template_reputation()
{
global $context, $settings, $options, $txt;

echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>';

if($context['error_txt'] == "")
echo '
<result>', cleanXml($txt['reputation_sent']), '</result>';
else
echo '
<error>', cleanXml($context['error_txt']), '</error>';

echo '
</smf>';
}



./Themes/default/scripts/script.js

var disappeardelay = 30 * 1000; // karma box hide display time, in milliseconds
var vertical_offset = "0px"; // vertical offset of karma box from image
var horizontal_offset = "-3px"; // horizontal offset of karma box from image

function getposOffset(what, offsettype)
{
var totaloffset = (offsettype=="left") ? what.offsetLeft : what.offsetTop;
var parentEl = what.offsetParent;

while (parentEl!=null)
{
totaloffset = (offsettype == "left") ? totaloffset + parentEl.offsetLeft : totaloffset + parentEl.offsetTop;
parentEl = parentEl.offsetParent;
}

return totaloffset;
}

function showhiderep(obj, e)
{
rep_box.style.left = rep_box.style.top = -500;
rep_box.widthobj = rep_box.style;
rep_box.widthobj.width = '300px';

if (obj.visibility == "visible"){
obj.visibility = "hidden";
obj.display = "none";
}
else
{
obj.visibility = "visible";
obj.display = "block";
}
}

function reputationForm(rep_contents, member_name, obj, e)
{
if(window.event)
event.cancelBubble = true;
else if(e.stopPropagation)
e.stopPropagation();

clearhidebox();

rep_box = document.getElementById("reputation_menu");
rep_fields = document.getElementById("reputation_fields");
rep_name = document.getElementById("reputation_name");
setInnerHTML(rep_fields, getInnerHTML(document.getElementById(rep_contents)));
setInnerHTML(rep_name, member_name);

showhiderep(rep_box.style, e);

rep_box.x = getposOffset(obj, "left");
rep_box.y = getposOffset(obj, "top");
rep_box.style.left = rep_box.x + "px";
rep_box.style.top = rep_box.y + obj.offsetHeight + "px";

delayhidebox();
}

function hidebox(e)
{
if(typeof rep_box != "undefined")
rep_box.style.visibility = "hidden";
}

function delayhidebox()
{
delayhide = setTimeout("hidebox()", disappeardelay);
}

function clearhidebox()
{
if(typeof delayhide != "undefined")
clearTimeout(delayhide);
}

var aReputation = new Array();

// *** Reputation object.
function Reputation(oOptions)
{
if (!this.isXmlHttpCapable())
return;

this.opt = oOptions;
this.funcParent = this;
}

// Determine whether the quick modify can actually be used.
Reputation.prototype.isXmlHttpCapable = function ()
{
if (typeof(window.XMLHttpRequest) == 'undefined')
return false;

// Opera didn't always support POST requests. So test it first.
if (typeof(window.opera) != 'undefined')
{
var test = new XMLHttpRequest();
if (typeof(test.setRequestHeader) != 'function')
return false;
}

return true;
}

// The function called after a user wants to save his precious message.
Reputation.prototype.sendRep = function (sSessionId)
{
var i, x = new Array();
var form = document.forms.reputation_form.elements;
x[x.length] = 'reputation_comment=' + escape(form['reputation_comment'].value.replace(/&#/g, "&#38;#").php_to8bit()).replace(/\+/g, "%2B");
x[x.length] = 'topic=' + parseInt(form['topic'].value);
x[x.length] = 'uid=' + parseInt(form['uid'].value);
x[x.length] = 'm=' + parseInt(form['m'].value);
x[x.length] = 'type=' + (form['type'][0].checked ? form['type'][0].value : form['type'][1].value);
x[x.length] = document.getElementById('sessionid').name + '=' + document.getElementById('sessionid').value;

// Happy Easter!
if(form['reputation_comment'].value == "about:reputation"){
alert("Version 1.7, for SMF 2.0 RC1. Code by Fustrate (http://www.fustrate.com/), who is pretty awesome.");
return;
}

// Send in the XMLhttp request and let's hope for the best.
ajax_indicator(true);
sendXMLDocument.call(this, smf_prepareScriptUrl(this.opt.sScriptUrl) + "action=xmlhttp;sa=reputation;xml", x.join("&"), this.onRepDone);

return false;
}

// Callback function of the XMLhttp request sending the modified message.
Reputation.prototype.onRepDone = function (XMLDoc)
{
// We've finished the loading stuff.
ajax_indicator(false);
hidebox();

// If we didn't get a valid document, just cancel.
if (!XMLDoc || !XMLDoc.getElementsByTagName('smf')[0])
return;

var result = XMLDoc.getElementsByTagName('smf')[0].getElementsByTagName('result')[0];
var error = XMLDoc.getElementsByTagName('smf')[0].getElementsByTagName('error')[0];

if (result)
{
alert(result.childNodes[0].nodeValue);
document.getElementById('repicon').style.display = 'none';
document.getElementById('repicon').style.visibility = 'hidden';
}
else if (error)
alert(error.childNodes[0].nodeValue);
}


oh! I think I found a Easter!    "about:reputation"   ;D

truhe

Quote from: SlammedDime on May 28, 2010, 02:24:28 PM
Quote from: truhe on May 24, 2010, 04:59:58 AM
Quote from: SlammedDime on May 12, 2010, 04:25:21 AM
I'll have test this to see what is causing it
Did you test it ? In my board the name is always replaced by the nick "Macy" which is the member with ID=1
Ok, figured this one out, will update in the next release... in the mean time you can apply this fix...

In Sources/Sitemap.php
Code (Find) Select
   // Gotta fix up some javascript laying around in the templates
   $extra_replacements = array(
      '/rand,' => '/rand=',
      $boardurl . '/topic/' => $scripturl . '?topic=',
      'var smf_scripturl = "' . $boardurl . '/' => 'var smf_scripturl = "' . $scripturl,
   );
   $buffer = str_replace(array_keys($extra_replacements), array_values($extra_replacements), $buffer);


Code (Replace) Select
   // Gotta fix up some javascript laying around in the templates
   $extra_replacements = array(
      '~/rand,~' => '/rand=',
      '~' . preg_quote($boardurl) . '/topic/~' => $scripturl . '?topic=',
      '~' . preg_quote('var smf_scripturl = "' . $boardurl) . '/~' => 'var smf_scripturl = "' . $scripturl,
      '~((?:to|bbc)Complete\.source.*?)/search/~' => '\\1/search,',
   );
   $buffer = preg_replace(array_keys($extra_replacements), array_values($extra_replacements), $buffer);


Thanks a lot.
I can't find Sources/Sitemap.php
do you mean Sources/SimpleSEF.php ?

SlammedDime

haha... yea, sorry.  Been coding too much the last few days, getting my files and mods mixed up.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

kpac

Quote from: SlammedDime on May 28, 2010, 02:07:17 PM
I realized I never FTP'd to your site to take a look at this... If you still need some help with it, let me know and I can take a look...
Thanks, but "Create Simple URLs" actually does the job perfectly anyway. :)

yoghurtfarmer

Hi, this mod is perfect.  Pretty URLs would give me a redirect error.

One question, is there a way to redirect the old standard URLs to the new urls?  I have links from other places that on longer work (goes to the forum index).

Thanks!

feline


Achilles.

Quote from: SlammedDime on May 28, 2010, 02:07:17 PM
Quote from: kpac on May 24, 2010, 01:10:00 PM
Quote from: Achilles. on May 24, 2010, 10:32:24 AM
Yep, it does work... However, I've got a problem regarding the mod rewriting, it gives me this link: http://mywebsite.com/home//_4.0.html not mywebsite/general_discussions and the like.
This seems to be a problem with some kinds of server configs.

See my post here, which is of a similar problem.
http://www.simplemachines.org/community/index.php?topic=352351.msg2622401#msg2622401
I realized I never FTP'd to your site to take a look at this... If you still need some help with it, let me know and I can take a look...

Achillies - I'd need FTP access to your site and a link to your board to test it out and see what is happening.


Hey, sorry for the delayed reply. Can we have a chat on MSN, so that we can communicate faster? If not it's okay, I'll send you the FTP account via PM. Thanks!

- All donations will proceed to my Youth Foundation.

http://poseidondesigners.tk/ -- Affordable Website Designs // Banners & More!

abadaba

Love this mod! I used pretty URLs for quite some time...i recently uninstalled due to redirect errors all over...A+ to the developer...check your beer money = )

coolfx350

I've been using Pretty URL, is this mod better?  What's the pros and cons over Pretty url?

coolfx350

i tried out this mod, it doesn't put any keywords on the url, pretty url does that.  Am I missing something?

mirahalo

Quote from: petecheng on June 04, 2010, 10:52:13 AM
i tried out this mod, it doesn't put any keywords on the url, pretty url does that.  Am I missing something?

this mod has nothing to do with keyboards nor modified keyboards

~DS~

Quote from: 130860 on June 04, 2010, 12:30:14 PM
Quote from: petecheng on June 04, 2010, 10:52:13 AM
i tried out this mod, it doesn't put any keywords on the url, pretty url does that.  Am I missing something?

this mod has nothing to do with keyboards nor modified keyboards
I hate people who thinks keywords actually help SEO. IT DOESN'T NOT.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Advertisement: