Codoforum related discussions
Codoforum SEO discuss

Thanks @RolluS. I've cleaned up them on github.

Hi @adesh1414127033 , could you please review this enhancement?

When sharing a forum link on Facebook, there's not any image display. Example this topic link: http://codologic.com/forum/index.php?u=/topic/3935/codoforum-seo-discuss
The root cause is that there is not og:image property in the Open Graph data

        <!-- Open Graph data -->
        <meta property="og:title" content="Codoforum SEO discuss" />
        <meta property="og:type" content="article" />
        <meta property="og:url" content="http://codologic.com/forum/index.php?u=/topic/3935/codoforum-seo-discuss/" />

        <meta property="og:description" content="Is there any one like SEO? :D I have some ideas and did them.Please give your comments if you like them.- Clean URL I hate this one:http://www.nguoianphu.com/index.php?u=category/news-and-ann..." />
        <meta property="og:site_name" content="CODOLOGIC" />

I suggest we add some lines into the sys\Controller\forum.php, line 421

        // Get image link for Facebook sharing

        // search the first image link from the first post of the topic
        $image = $posts[0]['message'];

        // initialize the image link with the default thumbnail image
        $img_src = 'http://www.domain.com/logo420.png';

       // pattern to get the src value in the img tag
        $pattern = '/src="([^"]*)"/';

      // If found image link, use it. Else, use the default
        preg_match($pattern, $image, $matches);
        if (!empty($matches[1])){
            $img_src = $matches[1];
        }
        unset($matches);

       // Set the Open Graph image property
        \CODOF\Store::set('og:image', $img_src);

I'm pretty sure that you have to correct my block of code. smile

Thanks @RolluS. I&#039;ve cleaned up them on github. Hi @adesh1414127033 , could you please review this enhancement? When sharing a forum link on Facebook, there&#039;s not any image display. Example this topic link: http://codologic.com/forum/index.php?u=/topic/3935/codoforum-seo-discuss The root cause is that there is not ```og:image``` property in the ```Open Graph data``` &amp;lt;!-- Open Graph data --&amp;gt; &amp;lt;meta property=&quot;og:title&quot; content=&quot;Codoforum SEO discuss&quot; /&amp;gt; &amp;lt;meta property=&quot;og:type&quot; content=&quot;article&quot; /&amp;gt; &amp;lt;meta property=&quot;og:url&quot; content=&quot;http://codologic.com/forum/index.php?u=/topic/3935/codoforum-seo-discuss/&quot; /&amp;gt; &amp;lt;meta property=&quot;og:description&quot; content=&quot;Is there any one like SEO? :D I have some ideas and did them.Please give your comments if you like them.- Clean URL I hate this one:http://www.nguoianphu.com/index.php?u=category/news-and-ann...&quot; /&amp;gt; &amp;lt;meta property=&quot;og:site_name&quot; content=&quot;CODOLOGIC&quot; /&amp;gt; I suggest we add some lines into the ```sys\Controller\forum.php```, line 421 // Get image link for Facebook sharing // search the first image link from the first post of the topic $image = $posts[0][&#039;message&#039;]; // initialize the image link with the default thumbnail image $img_src = &#039;http://www.domain.com/logo420.png&#039;; // pattern to get the src value in the img tag $pattern = &#039;/src=&quot;([^&quot;]*)&quot;/&#039;; // If found image link, use it. Else, use the default preg_match($pattern, $image, $matches); if (!empty($matches[1])){ $img_src = $matches[1]; } unset($matches); // Set the Open Graph image property \CODOF\Store::set(&#039;og:image&#039;, $img_src); I&#039;m pretty sure that you have to correct my block of code. :D
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).

Good job, and thanks smile

You didn't removed the CSRF_token: '{$token}' thing ?
(I didn't managed that myself without creating a bug in the template)

I like the og:image idea smile

Good job, and thanks ;) You didn&#039;t removed the ``` CSRF_token: &#039;{$token}&#039;``` thing ? (I didn&#039;t managed that myself without creating a bug in the template) I like the ```og:image``` idea :)

@RolluS , I keep the CSRF_token because I don't have the time out issue like you.

@RolluS , I keep the ```CSRF_token``` because I don&#039;t have the time out issue like you.
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).

Thanks @adesh1414127033 ,

If you have time, please help to adjust this code.

    // initialize the image link with the default thumbnail image
    $img_src = 'http://www.domain.com/logo420.png';

Might it be better like this?

    // initialize the image link with the default thumbnail image
    $img_src = A_DURI.'themes/'.$entry.'/thumbnail.png';
Thanks @adesh1414127033 , If you have time, please help to adjust this code. // initialize the image link with the default thumbnail image $img_src = &#039;http://www.domain.com/logo420.png&#039;; Might it be better like this? // initialize the image link with the default thumbnail image $img_src = A_DURI.&#039;themes/&#039;.$entry.&#039;/thumbnail.png&#039;;
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).

Hello @nguoianphu

When i submit, after done and my sitemap nothing to show.

It show only :

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"></urlset>

Help me way to fix it.

I'm using your modified source from https://github.com/nguoianphu/codoforums-vietnam

Thank you !

Hello @nguoianphu When i submit, after done and my sitemap nothing to show. It show only : ```` This XML file does not appear to have any style information associated with it. The document tree is shown below. &lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd&quot;&gt;&lt;/urlset&gt; ```` Help me way to fix it. I&#039;m using your modified source from https://github.com/nguoianphu/codoforums-vietnam Thank you !
edited May 25 '16 at 8:49 am

Hello @nguoianphu

When i submit, after done and my sitemap nothing to show.

It show only :

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"></urlset>

Help me way to fix it.

I'm using your modified source from https://github.com/nguoianphu/codoforums-vietnam

Thank you !

Can you try this debug?

http://codologic.com/forum/index.php?u=/topic/5540/how-to-properly-submit-a-sitemap-to-google-search-concole/1#post-13081

&gt;Hello @nguoianphu &gt;When i submit, after done and my sitemap nothing to show. &gt;It show only : &gt;```` &gt;This XML file does not appear to have any style information associated with it. The document tree is shown below. &gt;&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd&quot;&gt;&lt;/urlset&gt; &gt;```` &gt;Help me way to fix it. &gt;I&#039;m using your modified source from https://github.com/nguoianphu/codoforums-vietnam &gt;Thank you ! Can you try this debug? http://codologic.com/forum/index.php?u=/topic/5540/how-to-properly-submit-a-sitemap-to-google-search-concole/1#post-13081
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).
12
1.89k
27
5
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft