News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Pretty URLs

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

Previous topic - Next topic

vbgamer45

If you uninstall pretty urls does it show?

That sounds strange since this should just affect url structure.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Rgvill

Quote from: vbgamer45 on October 13, 2022, 11:29:48 PMIf you uninstall pretty urls does it show?

That sounds strange since this should just affect url structure.

Yes. It also shows up when I choose to rewrite the URL in Rewrite SMF Gallery URLs (even if I don't have an SMF Gallery installed on my forum, but I get a lot of errors "SMF Gallery Not Found" on log every seconds). When I installed the SMF Gallery, I don't get any errors, but the Simple Image Upload mod doesn't show up again.

vbgamer45

What is the error message you get in the log?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Rgvill

Quote from: vbgamer45 on October 14, 2022, 01:12:40 AMWhat is the error message you get in the log?

I reinstalled my forum. I just downloaded 2 mods (Simple Image Upload and Pretty Urls). The Simple Image Upload does not show up in my forum if Pretty Urls is enabled or installed. It shows up when I uninstalled/disabled Pretty Urls. No errors in the log.

Kindred

I believe this is a problem with the Image mod....
It has two references as so:  encodeURIComponent(document.location.href)

which, I suspect, does not take the re-write of PrettyURLs into account.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Rgvill

#8225
Quote from: Kindred on October 14, 2022, 09:27:06 AMI believe this is a problem with the Image mod....
It has two references as so:  encodeURIComponent(document.location.href)

which, I suspect, does not take the re-write of PrettyURLs into account.

Any fix to this?

Here is imgbb.js
// MOD Title: Simple Image Upload
// MOD Author: Sium < [email protected] > (N/A) http://imgbb.com/mod
// MOD Version: 2.0.0

if(typeof(imgbb_add_text)=='undefined')
{
    var imgbb_lang="en";
   
    var imgbb_add_text="Add movie image";
   
    var imgbb_style="padding:10px 0px 0px 0px;font-weight:bold;";
   
    var imgbb_skip_textarea=new RegExp("recaptcha|username_list|search|recipients|signature","i");
   
if(imgbb_lang=="en"){imgbb_lang="";}else if(imgbb_lang.indexOf(".")===-1){imgbb_lang+=".";}if(window.location.hash){var imgbb_text;var imgbb_hash;if(window.name.indexOf("imgbb_")===-1){imgbb_text=window.name;imgbb_hash=window.location.hash.substring(1).split("_");}else{imgbb_text=window.location.hash.substring(1);imgbb_hash=window.name.split("_");}if(imgbb_text!="" && imgbb_hash.length>1){if(imgbb_hash[0]=="imgbb"){var imgbb_id=imgbb_hash[1];imgbb_text=decodeURIComponent(imgbb_text);if(imgbb_text.length>20){if(opener!=null && !opener.closed){var imgbb_area=opener.document.getElementsByTagName('textarea');for(var i=0;i<imgbb_area.length;i++){if(i==imgbb_id){var editor=false;if(typeof opener.smf_editorArray==='object'){for(var A in opener.smf_editorArray){if(opener.smf_editorArray[A].opt.sUniqueId==imgbb_area[i].id){opener.smf_editorArray[A].insertText(opener.smf_editorArray[A].getText()+imgbb_text,true);editor=true;}}}if(editor==false){imgbb_area[i].value=imgbb_area[i].value+imgbb_text;}opener.focus();window.close();}}}}window.location.replace("//" + imgbb_lang + "imgbb.com/upload?mode=code&url=" + encodeURIComponent(document.location.href));}}}function imgbb_insert(){var imgbb_area=document.getElementsByTagName('textarea');for(var i=0;i<imgbb_area.length;i++){if(imgbb_area[i].name && !imgbb_skip_textarea.test(imgbb_area[i].name)){var attr=imgbb_area[i].getAttribute('data-imgbb');if(attr!="true"){var imgbb_div=document.createElement('div');imgbb_div.setAttribute('class',"imgbb");var imgbb_a=document.createElement('a');imgbb_a.innerHTML=imgbb_add_text;imgbb_a.href="javascript:imgbb_upload("+i+");";var imgbb_bullet=document.createElement('span');imgbb_bullet.setAttribute('class',"imgbb_bullet");imgbb_bullet.innerHTML="&#160;&#8226;&#160;";imgbb_div.appendChild(imgbb_bullet);imgbb_div.appendChild(imgbb_a);imgbb_area[i].setAttribute('data-imgbb',"true");if(new RegExp("quick","i").test(imgbb_area[i].name)==false && imgbb_area[i].nextElementSibling && new RegExp("resize","i").test(imgbb_area[i].nextElementSibling.id)){imgbb_div.setAttribute('style',imgbb_style);imgbb_area[i].parentNode.insertBefore(imgbb_div,imgbb_area[i].nextSibling);}else if(new RegExp("quick","i").test(imgbb_area[i].name)==false && imgbb_area[i].parentNode.nextElementSibling && new RegExp("resize","i").test(imgbb_area[i].parentNode.nextElementSibling.id)){imgbb_div.setAttribute('style',imgbb_style);imgbb_area[i].parentNode.parentNode.appendChild(imgbb_div);}else if(new RegExp("quick","i").test(imgbb_area[i].name)==false && imgbb_area[i].nextElementSibling && imgbb_area[i].nextElementSibling.nextElementSibling && new RegExp("resize","i").test(imgbb_area[i].nextElementSibling.nextElementSibling.id)){imgbb_div.setAttribute('style',imgbb_style);imgbb_area[i].parentNode.insertBefore(imgbb_div,imgbb_area[i].nextSibling.nextSibling);}else{if(imgbb_area[i].nextSibling.nextSibling){imgbb_area[i].parentNode.insertBefore(imgbb_div,imgbb_area[i].nextSibling.nextSibling);}else if(imgbb_area[i].nextSibling){imgbb_area[i].parentNode.insertBefore(imgbb_div,imgbb_area[i].nextSibling);}else{imgbb_area[i].parentNode.appendChild(imgbb_div);}}}}}}function imgbb_upload(areaid){window.open("//" + imgbb_lang + "imgbb.com/upload?mode=smf&code=hotlink&url=" + encodeURIComponent(document.location.href),"imgbb_" + areaid,"resizable=yes,width=720,height=550");return void(0);}if(typeof(window.addEventListener)=='function'){window.addEventListener('DOMContentLoaded',imgbb_insert,false);window.addEventListener('load',imgbb_insert,false);}else if(typeof(window.attachEvent)=='function'){window.attachEvent('onload',imgbb_insert);}else{if(window.onload!=null){var old_onload=window.onload;window.onload=function(e){old_onload(e);imgbb_insert();};}else{window.onload=imgbb_insert;}}for(var i=1;i<12;i+=2){setTimeout("imgbb_insert()",i*1000);}imgbb_insert();}

MarkRH

I am testing out the latest version on 2.1.3 version of the board locally prior to upgrading the one at my webhost.  I am upgrading from version 2.1 RC3 since that version doesn't work well with PHP 8.1.

Anyway, the update seems to have gone well.. all my URLs look good except the login one which still looks like (Url)/index.php?action=login and not (Url)/login/ when I click on the login button at the top.  The Signup button URL looks fine though.

Is this the intended behavior now?  I can manually go to (Url)/login/ and it will redirect to it.  Looking at the .htaccess and the redirect is in there. 

So, what should I check at this point or do I need to remove all traces of it and try again?

Thanks,
Mark H.
Mark H.

MarkRH

As a follow-up I looked in the smf_pretty_urls_cache and the `B/index.php?action=login url_id had a replacement of the same thing: `B/index.php?action=login which explains why that did not get replaced.

On the site at my host, it has `B/login/ as the replacement value which is why it still shows that URL.
Mark H.

vbgamer45

It is skipped on purpose. For some reason it breaks in SMF 2.1 with the popups.
We skip actions login, login2, logintfa  you can them in sources/PrettyUrls-Filters.php
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

MarkRH

Quote from: vbgamer45 on December 10, 2022, 10:50:55 AMIt is skipped on purpose. For some reason it breaks in SMF 2.1 with the popups.
We skip actions login, login2, logintfa  you can them in sources/PrettyUrls-Filters.php

What I figured.  I'll leave it be then. :)
Thanks for all your work.
Mark H.

Marina3

#8230
ERROR!
Invalid argument supplied for foreach() and Trying to access array offset on value of type null.
/Themes/default/GenericMenu.template.php (269):
foreach ($tab_context['tabs'] as $sa => $tab).

ERROR!
Trying to access array offset on value of type null.
/Themes/default/GenericMenu.template.php (269):
foreach ($tab_context['tabs'] as $sa => $tab).

ERROR!
Trying to access array offset on value of type null.
/Themes/default/GenericMenu.template.php (261):
', sprintf($txt['mobile_generic_menu'], $tab_context['title']), '.

ERROR!
Trying to access array offset on value of type null.
/Themes/default/GenericMenu.template.php (255):    
<span class="text_menu">', sprintf($txt['mobile_generic_menu'], $tab_context['title']), '</span>

ERROR!
Undefined index: pretty_enable_filters.
/Sources/MessageIndex.php (32):
if ((isset($context['pretty']['oldschoolquery']) || $context['pretty']['query_string']['board'] != $context['pretty']['board_urls'][$board]) && $modSettings['pretty_enable_filters'])

vbgamer45

Have posted an update that might help.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

lntit

Hi,
I'd like to ask if there is a solution for the issue described in the quote below?
(SMF 2.1.3, PrettyURLs 2.5.1c, PHP 7.4)

Quote from: gevv on February 16, 2022, 12:03:14 PMHi,

Https or non-http links are broken




forum ;  https://site.com/forum

link added to topic (without http or https):  site.com/forum  or another site link  anothersite.com

clickable link html output


<a href="https://site.com/forum///site.com/forum/" class="bbc_link" target="_blank" rel="noopener">site.com/forum/</a>





<a href="https://site.com/forum///anothersite.com" class="bbc_link" target="_blank" rel="noopener">anothersite.com</a>



SMF 2.1.1, Pretty Urls 2.5 PHP 7.4

vbgamer45

There is not currently.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

stog

Hi (have posted this ask in the support as well excuse me)

I am upgrading from 2.019 to 2.13 an old and fairly large forum

the upgrade is stalling at pretty_urls_cache (step 6 conversion to UTF-8)

I am wondering whether to empty the pretty_urls_cache table from phpmyadmin?

any advice gratefully received

thx

vbgamer45

You can empty that cache it will be rebuilt.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Marina3

Error: Undefined array key "pretty_enable_filters" on php 8.1 and SMF 2.1.3.
How do I fix this error?

vbgamer45

Check the setting and save to enable. It  should only appear once.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

SomeoneElse

I'm on SMF 2.0.19, and I still have Pretty URLs 2.3 installed. I'd obviously like to update to 2.5.1c, but when I download the package from here into the Packages directory as PrettyUrls2.5.1c.zip it appears with version 2.3 in the Package Manager list, but with a red 'older version' image. Consequently, there's no upgrade button available for it.

Why does SMF think that PrettyUrls2.5.1c.zip is an older package than PrettyUrls2.3.zip?

vbgamer45

It could be maybe due to the letter c in version numbering which might throw it off.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: