News:

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

Main Menu

Optimus

Started by Bugo, February 15, 2011, 03:48:12 PM

Previous topic - Next topic

Dblog

Is there anyway to  do these topic/board settings ?

{board_name} -  {forum_name} - page {#}

{topic_name} - {board_name} - {forum_name} - page {#}

if i try to display page {#} in 3rd column, it doesnt show actual number but just shows the word : page {#}, # doesnt get replaced by number.
it only happens if {#} is used in 2nd column.

Portugal

#321
Hi all,

Its possible to change the original configuration of that mod on "Display the first sentence of the current page first message as the meta-tag description" to the firsts 50 words, or the 2 firsts sentences? I apreciate to do this on my particular situation.


Thanks in advance.
From Portugal

asura88

It's a great mod, but the whole META description parsing method is imperfect in my opinion.
For example, if someone started their topic with:
"Hello. (content)", the description would look as follows: "Hello", since it's coded to show only the first sentence (ended with dot or exclamation mark).
I have simplified the description function and it should now correctly deal with this issue. In addition it will now also remove the trimmed (cut) last word from the description and empty spaces from the messages started with new line. I would like to point out that I am still coding noob, but there's nothing advanced, so.

Sources/Subs-Optimus.php
function optimus_meta_teaser()
{
global $context, $txt, $smcFunc;

if ($context['is_poll'])
{
$teaser = $txt['poll'] . ': ' . $context['poll']['question'] . ' (' . $context['page_info']['current_page'] . ')';
}
else
{
$request = $smcFunc['db_query']('', '
SELECT SUBSTRING(body, 1, 200)
FROM {db_prefix}messages
WHERE id_msg = {int:id_msg}
LIMIT 1',
array(
'id_msg' => $context['first_message']
)
);

list ($teaser) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
}

$teaser = optimus_meta_chars(str_replace('<br />', ' ', parse_bbc($teaser, false)));
$teaser = trim($teaser);
$teaser = str_replace("&nbsp;", "", $teaser);

if ($smcFunc['strlen']($teaser) < 150) return strip_tags($teaser);

$teaser = preg_replace('/\s+?(\S+)?$/', '', substr($teaser, 0, 150));

return strip_tags($teaser);
}


Quote from: Portugal on July 04, 2014, 10:38:39 AM
Hi all,

Its possible to change the original configuration of that mod on "Display the first sentence of the current page first message as the meta-tag description" to the firsts 50 words, or the 2 firsts sentences? I apreciate to do this on my particular situation.


Thanks in advance.
From Portugal
In the function above just change 150 to 50 in two places.

Portugal

Hi,

Thanks Homeland for your work on this. Now i will go to implement this modification, after to see the results i will give my feedback here.

Regards

swaggaderby

this is what i get from the robot text am told to copy to the right. and im not sure its correct

User-agent: Googlebot-Image
Disallow: /

User-agent: YandexImages
Disallow: /

User-agent: msnbot-MM
Disallow: /

User-agent: Googlebot-Mobile
Allow: /*wap
Disallow: /

User-agent: YandexImageResizer
Allow: /*wap
Disallow: /

User-agent: MediaPartners-Google
Allow: /

User-agent: *
Allow: /$
Allow: /*.xml
Disallow: /attachments/
Disallow: /avatars/
Disallow: /Packages/
Disallow: /Smileys/
Disallow: /Sources/
Disallow: /Themes/
Disallow: /*msg
Disallow: /*profile
Disallow: /*help
Disallow: /*search
Disallow: /*mlist
Disallow: /*sort
Disallow: /*recent
Disallow: /*register
Disallow: /*groups
Disallow: /*stats
Disallow: /*unread
Disallow: /*topicseen
Disallow: /*showtopic
Disallow: /*prev_next
Disallow: /*imode
Disallow: /*wap
Disallow: /*all
Disallow: /*action
Disallow: /*PHPSESSID
Crawl-delay: 5

swaggaderby

Quote from: infoseeker on September 18, 2011, 09:54:25 PM

Thanks Bugo.
All my problem is happened by my meta tags. Now every thing is fine.
The new version of optimusbrave is very nice. The recommended format of robots.txt is ultimate.

Thanks a lot for creating this mod

Below iam giving some useful links for our smf users to check their website's strength, and errors.

The below website can help you to create website's meta tags. dont use refresh page meta tag. Because, the meta tag is related with spam problems.

http://www.onlinemetatag.com

The below website can analyze your website's meta description.

http://www.submitexpress.com/analyzer/

Thats all. :)
Thanking you.
the website u gave to analyze my website meta description seems to be giving me error whenever i try checking it dunno if you can help out

Thilo

Hi there,

a very nice Mod! Thanks for sharing it!!!

Just on thing. On my forum (quite big one) almost everytime a Posting ist made the following error shows up:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4194207 bytes) in /var/www/sites/xxx/html/forum/Sources/Subs-Optimus.php on line 705..."

To me it seems that creating the xml-sitemap for google needs to much memory (probably because it's quite big - 40.000 Urls) ?
Is that right ? Does Optimus Brave updates that file each time a new thread is transmitted?

Ok - one thing would be - to enlarge the memory of course. (Shouldn't actually be a big problem)

But on the other side: Maybe it's worth to do another logic in creating the sitemap.
(i don't know - maybe every hour as a cron-job or something else...? Cause i believe if there is a huge forum and we have rush-hour with many users writings posts, it could quite annoy the server... ;- ) )

Greets,

Thilo

Thilo

Just another thought:

Another Solutions would be for example an option to put only the newest 10.000 URLs insinde the sitemap...


Kindred

well, since I used this on a site with over 3 millions posts... I think there may be something else going on with you...
Сл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."

Thilo

That's interesting.

How many URLs are inside your sitemap.xml ?

Should be more than 50.000, right ?


Can you tell me what's your "allowed memory size" for php on your server ?



Arantor

I thought sitemaps individually weren't permitted above 50k URLs anyway?

Thilo

If that's so, (and im sure you are right) than a option to set a limit somewhere inside the mod would definetely make sense!

Arantor

Just for clarification, http://www.sitemaps.org/protocol.html says this:

QuoteYou can provide multiple Sitemap files, but each Sitemap file that you provide must have no more than 50,000 URLs and must be no larger than 10MB (10,485,760 bytes). If you would like, you may compress your Sitemap files using gzip to reduce your bandwidth requirement; however the sitemap file once uncompressed must be no larger than 10MB. If you want to list more than 50,000 URLs, you must create multiple Sitemap files.

Thilo

Hi there,

again me. I checked my xml Sitemap and it's already 9 MB.
So there isn't much left 'til it reaches the max. allowed size...

In Kindreds site it should be already way larger than the allowed size.

So for some users it would be a very friendly option to limit the sitemap to a size the board-admin can chose ?

i really would appreciate that!

Black Tiger

I just installed this mod, but it seems I'm missing something somewhere, because I read this on some site:
Quoteall you need is to do is to install Optimus Brave in your forum and click Schedule tasks to generate and enable your sitemap
However... I don't see anything about sitemap or Optimus or Brave in the Schedule tasks.

I left every setting default, I only activated to generate sitemap:
QuoteCreate and periodically update Sitemap XML-file

What am I doing wrong?
Greetings, Black Tiger

Black Tiger

I've seen this problem a couple of times in this 17 page thread, also seen 1 time that it was fixed, but not how it was fixed.
Does anybody have a clue on what's causing this?

No Scheduled task present in the scheduled tasks manager and no option "Create forum map" either.
Greetings, Black Tiger

Armada

I've a strange problem here.

I installed Optimus Brave, but when I looked at the metadata of pages it had not changed anything.

I then read that perhaps Pretty URL didn't work well with it. SO I uninstalled Pretty URLs.

Then I could see Optimus Brave changes in the metadata. So then it worked. Great.  Whoohoo.

Anyway I've broken something, because it doesn't work now. Argh!

As a background the things I did that might have messed it up is:

Checking/repairing database because of a crash yesterday (sessions table shown as crashed)
Also, Six of the boards on out forum were using a different theme to the rest of the forum, I changed them back to the overall forum default.

So any pointers on how to get this working again would be much appreciated.
Thanks.

I've attached an image of the settings. Were using SMF 2.0.9.
Armada
--- SMF Rocks even more than YabbSE---

Armada

I think I've found the problem and fixed it.  :) Hopefully this will help somebody if you have the same problem.

To try and work out what is going on, I had a look at the latest modified files.

I saw something interesting in changes in Load.php by running "diff" to see the changes:


diff Load.php~ Load.php

11c11
<  * @version 2.0.7
---
>  * @version 2.0.9
2746a2747,2753
>
> // Invalidate the opcode cache
> if (function_exists('opcache_invalidate'))
>    opcache_invalidate($cachedir . '/data_' . $key . '.php', true);
>
> if (function_exists('apc_delete_file'))
>    @apc_delete_file($cachedir . '/data_' . $key . '.php');



It's something to do with caching.
So I went to my caching options under Admin > Server Settings > Caching and I changed it from "Level 2" caching to "No caching" then went back in and changed it from "No caching" to "Level 1" caching.

Now it works :)

Armada
--- SMF Rocks even more than YabbSE---

MESWEB

How to add download file (all files have title, description and much more) from Download System mod to sitemap?

B3aker

Hi. This add on's been working great for the last couple years but I do have a new problem I hope someone can answer for me. Whenever I or someone on my forum tries to upload an attachment, this error pops up. It's only been a recent thing like within the last week.

QuoteFatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 5603761 bytes) in /home/xxxx/xxxxxx_xxxx/community/Sources/Subs-Optimus.php on line 780

Any help would be appreciated. Don't want to have to uninstall this mod :)
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

Advertisement: