Resource icon

Svg Template by Xon 1.6.1

No permission to download
https://forums.sufficientvelocity.com/ <- the logo is a SVG which automatically adapts based on light/dark styling. The SVG is stored in the XF template system, and has access to the style, and style properties meaning it can be easily changed without re-editing it.

I use these in a few other add-ons (Dice roller, & the warning icons in the mod blocks in Advanced BbCodes Pack)
 
I never get to make this add-on working. The server always returns 404 when requesting svg.php file
this is my localhost
hWDU0Xg.png

I copied the svg file to test.php and put some simple contents.
test.php is working. (loading phpinfo page)

but svg.php file never works.

dJrCoxA.png

b7kb458.png


I've even tried this on my staging server which is running centminmod
It gives the same error 404

I've tried this add-on before. then I gave up on this add-on and found an alternative way. Then again I needed to work with svg file now, and the add-on still not working for me. Can you please spot the issue?
 
svg.php returns a 404 if you don't pass it a valid svg template name to render.

Create a sample.svg template (with some valid svg content), and then try accessing svg.php?svg=sample.svg&s=<defaultStyle>&l=<defaultLanguage>, where <defaultStyle> should be the id of the style the template is in, and <defaultLanguage> whatever id for the language that should be used.

I can't offer advice on webserver configuration over the sample rewrite rules. There is the "Support SVG url's in XF routing layer" which moves the URL handling to XenForo which may help.
 
svg.php returns a 404 if you don't pass it a valid svg template name to render.

Create a sample.svg template (with some valid svg content), and then try accessing svg.php?svg=sample.svg&s=<defaultStyle>&l=<defaultLanguage>, where <defaultStyle> should be the id of the style the template is in, and <defaultLanguage> whatever id for the language that should be used.

I can't offer advice on webserver configuration over the sample rewrite rules. There is the "Support SVG url's in XF routing layer" which moves the URL handling to XenForo which may help.
Amazing!
I got it finally working. Thank you for not letting me die that dumb :D
 
I tried to understand this add-on. I tried to follow what's mentioned in this thread.

But I failed.

I added the rewrite code in nginx conf file. After a restart of the server, an svg.php file was created in root directory.

Then what? What am I supposed to do with this add-on? a template.svg with svg content? Then it's actually am svg file? Where do I save it to? Create the folder /data/svg and put all svg files (call it template.svg now?) into that??

I believe many people gave up on this add-on because it's quite difficult to understand. I wish someone can enlighten me.
 
Xon updated SVG Template by Xon with a new update entry:

2.3.0 - Feature update

  • Add basic validation that an SVG template should render correctly
  • Add an optimization pass for SVG's. Prunes pruning whitespace and nodes/attributes known to be safe to remove. Includes minifying any inline css.
  • Support LESS/CSS in SVG's <style> element.
  • Add option "Render SVG's as PNG for mobile devices", this supports rewriting calls to getSvgUrl from .svg to .png

Read the rest of this update entry...
 
Xon updated SVG Template by Xon with a new update entry:

2.3.2 - Bugfix update

  • Require Standard Lib by Xon v1.1.0+
  • Force usage of global functions so php can optimize them into special bytecode instead of function calls
  • Fix disabling generating png links if svg => png is not configured
  • Improve installer to report svg => svg conditions which can block usage
  • Use "canonical" URL before XF2.2.3 as "full" doesn't work as expected in all contexts

Read the rest of this update entry...
 
Installed and added the Apache URL rewrite, I feel like an idiot.. what could I be missing?

1625211445212.png

Getting a 404 error, and data/svg doesn't exist.. sorry if I'm being an idiot 😅
 
I haven't really heavily tested the apache bits, and they could be broken :(

It might be best to revert the apache changes and then use the "Support SVG url's in XF routing layer" feature.

Rewrite rule debugging is an absolute pain.
 
Back
Top Bottom