2024-02-09, 09:31 AM
Hi,
i tossing around with MyCode for fun and suddenly *bang* i had embedded Telegram in my forum
If you are interessted in this feature, here is the salt:
1. It is a cascading MyCode. We need 2 MyCode for to do one thing.
Telegram1:
Do not use (.*?) in Telegram1!!!! Use (.*)!!!
(there is a thread where you can smell my despair cause of that https://community.mybb.com/thread-240205.html)
and Telegram2:
What is essential is the "parse-order". Telegram1 has the 0, will executed first. Telegram2 has the 1, will be executed after Telegram1 has did its thing.
2. Also we have to add some code in global.css
x {
border: 1px solid #ccc;
margin: 0;
background: #fff;
padding: 10px;
display: inline-flex;
flex-flow: row wrap;
justify-content: center;
}
Yes, i just define a new "tag" x for that. You also can use "blockquote" or "span" ect. for that. But cause of all others are often used and somtimes specialized, there is a high chance that we would interfere in some formats e,g, the normal "blockquote cite" or like that. So better do a stand alone tag.
3. How it works
copy the url of a single Telegram-post, e.g. https://t.me/fcukalender/6, paste it in your post-reply, send your post reply, and then you get this telegram-post automatic embedded in your post in your forum, what then looks like that
Have fun with it
i tossing around with MyCode for fun and suddenly *bang* i had embedded Telegram in my forum
If you are interessted in this feature, here is the salt:
1. It is a cascading MyCode. We need 2 MyCode for to do one thing.
Telegram1:
Quote:https://t.me/(.*)
Quote:[telegram]$1[/telegram]
Do not use (.*?) in Telegram1!!!! Use (.*)!!!
(there is a thread where you can smell my despair cause of that https://community.mybb.com/thread-240205.html)
and Telegram2:
Quote:\[telegram\](.*?)\[/telegram\]
Quote:<x><script src="https://telegram.org/js/telegram-widget.js?22" data-telegram-post="$1" data-width="100%" ></script></x>
What is essential is the "parse-order". Telegram1 has the 0, will executed first. Telegram2 has the 1, will be executed after Telegram1 has did its thing.
2. Also we have to add some code in global.css
x {
border: 1px solid #ccc;
margin: 0;
background: #fff;
padding: 10px;
display: inline-flex;
flex-flow: row wrap;
justify-content: center;
}
Yes, i just define a new "tag" x for that. You also can use "blockquote" or "span" ect. for that. But cause of all others are often used and somtimes specialized, there is a high chance that we would interfere in some formats e,g, the normal "blockquote cite" or like that. So better do a stand alone tag.
3. How it works
copy the url of a single Telegram-post, e.g. https://t.me/fcukalender/6, paste it in your post-reply, send your post reply, and then you get this telegram-post automatic embedded in your post in your forum, what then looks like that
Have fun with it