Go Down

Topic: Forum Feature Request: Signature line image url tags (Read 1 time) previous topic - next topic

travis_farmer

Jan 24, 2018, 07:17 pm Last Edit: Jan 25, 2018, 10:31 am by travis_farmer
i am requesting the ability to insert an image URL into my signature line. it doesn't need to be very big. 100X100 pixels would be enough.

as i run my own, but very under used, forum using SMF, i am aware the ability should be configurable.

what i intend to use it for is to place a dynamic image, like what will follow, in my signature line to alert those interested that my internet radio station, will be Arduino related content (when started), that the radio station is on-air. i have created an initial dynamic image that illustrates my point, though it is not yet within the size listed above, yet.

(EDIT: Dynamic image redacted)

the radio station may or may not be on-air when you view, but the image will change to reflect the status. i don't need to upload the image, i just need to have the ability to use the img BBCODE tag in the signature line.

I thank you for your consideration and time.

~Travis

robtillaart

IIRC this was turned off in the past as it caused quite some visual spam unfortunatelly
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Robin2

Can't you just include the image in any Reply that you post?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Coding Badly

#3
Jan 25, 2018, 02:49 am Last Edit: Jan 25, 2018, 02:50 am by Coding Badly
i am requesting the ability to insert an image URL into my signature line.
One particularly selfish member of the forum included a dynamic image in his signature (like you want to do) but failed to properly test his code.  The buggy code sent corrupt massive images.  Bear in mind that, because the image was dynamic, EVERY SINGLE POST OF HIS CURRENTLY IN VIEW required fetching the image.  His mistake left the forum inaccessible.  Adding insult to injury the miscreant refused to remove the signature; insisting he could not possible be the cause.  I wasted about 30 hours of my life dealing with his mistake and his bullshit attitude.

I will fight tooth and nail to block signature images on this forum. 

In any case, the moderators no longer have the ability to enable signature images so you would have to take your request "upstairs".

Just so you know, this...
  $json = file_get_contents("http://tjfserver.ddns.net:8000/status-json.xsl");
...is a serious problem.  If your server is down we will all wait for file_get_contents to timeout.  For each of your posts that is visible.


Coding Badly

course, if the server is down, it is likely so is the PHP source ;)
I did assume "radio server" and "web server" are wrapped in different containers (e.g. different computers).

Quote
and to limit issues, perhaps i will just limit posting the dynamic image to when i want to alert that the radio station is on-air.
The usual strategy when such things are a concern is to have a separate thread of execution (e.g. dedicated daemon or something in your radio server) that outputs (copies / links / moves) a static image based on the current status.  The web server serves the static image with a no-cache or short-time-cache setting.  Doing that breaks the interconnect between the two servers.

And, if you REALLY want to get fancy check the image timestamp in your PHP code.  If the image is older than expected serve a "the whole freaking mess is dead" static image.

Another option is to put a database (ideally on the same hardware as the web server) between the status-checker and the web server.  The status-checker updates a database record based on the radio server's status.  The web server queries the database server for the current status then serves a static image based on that status.  As an added bonus you can log up-time and other information in the same database.


Coding Badly

#5
Jan 25, 2018, 10:38 am Last Edit: Jan 25, 2018, 10:39 am by Coding Badly

Excellent.

There is a small window of time in which /var/www/icecast_status.json will not exist which, if the timing is just right, should cause the PHP code to bail with an exception.  I suggest changing the CRON script to perform a two-phase commit (will narrow the window) and adding a retry / graceful recovery to the PHP code.


Robin2

well... yes. it would be a royal PITA, but i could do it that way.
I don't see how it could be.

Just upload the image (or the two images) into one of your Posts. Then figure out the URL for each image and have a text file on your PC with a line for each one - something like

[img]http://forum.arduino.cc/index.php?action=dlattach;topic=524678.0;attach=242615[/img]

then all you have to do is copy that line into any Post where you want the image to appear.



...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Coding Badly


Excellent!  Great work!

(I had just quickly eye-balled for trouble.)

Coding Badly

Code: [Select]

Cache-Control:max-age=0


Nice choice for cache-control!


Coding Badly


@travis_farmer, would you like your site to be at tjfserver.net instead of tjfserver.ddns.net?  (Drop the "ddns".)

If "yes" I have a suggestion that is very cheap ($12 per year including the domain name).


Coding Badly


What I have in mind is, quite literally, a replacement for ddns.net.  You would be replacing them with a different Dynamic DNS service; one that includes Dynamic DNS (and privacy) with the cost of the domain name.

Quote
...my ISP actually stated that i would have to get a commercial DSL account if i had a full domain name...
Is that part of the agreement?

(That sort of bullshit is why Net Neutrality is actually important.  As long as you don't exceed the agreed-upon data-rate it should be (mostly) none of their business what goes over the wire.)


Coding Badly


Register the domain name...
https://domains.google.com

Follow the instructions...
https://support.google.com/domains/answer/6147083?hl=en

Configure your router to forward port 80 (and 443) (which you've already done).

Enjoy.  The whole process took me less than four minutes!

If you are using Linux, ddclient (latest version) is dead simple to configure.  (I don't know if ddclient is available for Windows.)

If you use ddclient, the router only has to perform port forwarding; the router is not used to maintain the IP address.


Coding Badly


Exactly.  When the update request is sent to Google Domains it knows your internet facing IP address because that address is part of the TCP protocol.


Go Up