<?xml version="1.0" encoding="windows-1251"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://testscripting.rusff.me/export.php?type=rss" rel="self" type="application/rss+xml" />
		<title>Test</title>
		<link>https://testscripting.rusff.me/</link>
		<description>Test</description>
		<language>ru-ru</language>
		<lastBuildDate>Wed, 27 Jul 2022 23:28:29 +0300</lastBuildDate>
		<generator>MyBB/mybb.ru</generator>
		<item>
			<title>Тестовое сообщение</title>
			<link>https://testscripting.rusff.me/viewtopic.php?pid=17#p17</link>
			<description>&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;const USER_PAGE = &#039;user_page&#039;; // адрес страницы юзера в админке
const PROFILE_FIELD_ID = &#039;fld4&#039;; // id поля профиля, где находится ссылка на страницу подарков

function add_link(data) {
    // ссылка в постах

    $(&amp;quot;#pun-viewtopic .post .post-author&amp;quot;).each(function () {
        let added_id = $(this).closest(&#039;.post&#039;).attr(&#039;data-user-id&#039;);
        let presents_personal_link = &#039;&amp;lt;strong id=&amp;quot;presentsPage&amp;quot;&amp;gt;&amp;lt;a href=\&amp;quot;/pages/&#039; + USER_PAGE + &#039;?id=&#039; + added_id + &#039;\&amp;quot;&#039; + &#039;title=\&amp;quot;Страница подарков\&amp;quot; target=\&amp;quot;_blank\&amp;quot;&amp;gt;Подарки &amp;lt;/a&amp;gt;&amp;lt;/strong&amp;gt;&#039;;
        if (typeof data[added_id] !== &amp;quot;undefined&amp;quot;) {
            presents_personal_link = presents_personal_link + data[added_id];
        } else {
            presents_personal_link = presents_personal_link + &#039;0&#039;;
        }
        $(this).find(&#039;.pa-&#039; + PROFILE_FIELD_ID).html(presents_personal_link);
    });

// ссылка при просмотре профиля
    if ($(&#039;#viewprofile-next&#039;).length &amp;gt; 0) {
        let profile_id = $(&#039;#viewprofile-next&#039;).attr(&#039;class&#039;).split(&#039; &#039;)[1].replace(&#039;id-&#039;, &#039;&#039;);
        let profile_personal_link = &#039;&amp;lt;a href=\&amp;quot;/pages/&#039; + USER_PAGE + &#039;?id=&#039; + profile_id + &#039;\&amp;quot;&#039; + &#039;title=\&amp;quot;Страница подарков\&amp;quot; target=\&amp;quot;_blank\&amp;quot;&amp;gt;Подарки&amp;lt;/a&amp;gt;&#039;;
        $(&#039;#pa-&#039; + PROFILE_FIELD_ID).find(&#039;strong&#039;).html(profile_personal_link);
    }
}

function justTesting() {
  return (async () =&amp;gt; {
            let response = await fetch(&#039;http://127.0.0.1:5000/&#039; + &#039;getpresentscount&#039;, {
                method: &#039;POST&#039;,
                headers: {
                    &#039;Content-Type&#039;: &#039;application/json&#039;
                },
            });

            let result = await response.json();
            let data = JSON.parse(JSON.stringify(result));
    	    return data[&#039;answer&#039;];
    	})();
};
justTesting().then(res =&amp;gt; {
     let data = res;
     add_link(data);
  })
  .catch(err =&amp;gt; {
    console.log(err);
  });&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (Leraje)</author>
			<pubDate>Wed, 27 Jul 2022 23:28:29 +0300</pubDate>
			<guid>https://testscripting.rusff.me/viewtopic.php?pid=17#p17</guid>
		</item>
		<item>
			<title>ythhh</title>
			<link>https://testscripting.rusff.me/viewtopic.php?pid=5#p5</link>
			<description>&lt;p&gt;bbb&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Leraje)</author>
			<pubDate>Wed, 06 Jul 2022 10:22:56 +0300</pubDate>
			<guid>https://testscripting.rusff.me/viewtopic.php?pid=5#p5</guid>
		</item>
	</channel>
</rss>
