XF 2.2 How would I go about adding an external generated counter (the US debt clock) to my forum?

jayhawku

Member
It's kind of an inside joke regarding an older forum but many are clamoring to see if I can add the US debt clock to the top of my forum. There is a website that has it and even a link to adding the widget w/ the code already written: https://www.usadebtclock.com/ https://www.usdebtclock.org/#

<iframe src="http://www.usadebtclock.com/us-debt-clock-widget.php" height="80" width="350" scrolling="no" frameborder="0">
</iframe>
<p>Visit <a href="http://www.usadebtclock.com/" target="_blank">USADebtClock.com</a> to learn more!</p>

Any clue how I might just add the number in a grey box somewhere? The theme I purchased already has a countdown timer so was going to ask them but think this might be a custom job..

Thanks for help for such a trivial question.
 
Thanks @Paul B. Any idea where I can get advice on how to add the widget to my forum? I think I put the HTML in the right place but I don't see it on the site through trial and error and I just don't know how to add it. Looked in the manual but for me, how to enable/where it goes is hard to understand/vague for a beginner.

Thanks
 

Attachments

  • Screenshot 2024-01-28 193706.webp
    Screenshot 2024-01-28 193706.webp
    72.7 KB · Views: 22
First things first have you got a copy of the default xenforo style on your site? Does the widget show on the default style?

Your setup looks OK but I haven't made a widget in so long.
 
I've managed to get the widget to display on a demo install - the iframe appears to have issues though.

See attached. You may need a new embed code.
 

Attachments

  • Screenshot_20240129_022941_com.android.chrome.webp
    Screenshot_20240129_022941_com.android.chrome.webp
    46.7 KB · Views: 18
  • Screenshot_20240129_022950_com.android.chrome.webp
    Screenshot_20240129_022950_com.android.chrome.webp
    23.8 KB · Views: 18
OK ignore all of the above. It's nearly 3am 🤦‍♂️

If your site is using https you will have to amend the iframe src to be https also. This worked for me on the demo install. See it in action here:

Your widget definitions in the xenforo control panel look fine. If it still isn't displaying it must be a style issue.
 
Wow. Thank you so much @James!

I cannot replicate the results you got so it must be a style issue as I bought a theme. Trying to get a hold of the theme maker now so I'll cross my fingers.

Thanks again for your help!
 
I changed the first one to S and it didn't work but will try changing them both when I get back from this dog walk.

Thx. I also contacted theme creator to see if he had any input.
I just added it to my forum, for one specific (political) subforum/node only, below the quick reply box. It had to be https to work.

The debt is too wide for the sidebar, and that seemed to be the only position available for a sub node.

1706532788978.webp
 
I just added it to my forum, for one specific (political) subforum/node only, below the quick reply box. It had to be https to work.

The debt is too wide for the sidebar, and that seemed to be the only position available for a sub node.

View attachment 297393
Thanks so much for testing it out. I am literally entering the exact same thing you guys are and it doesn't appear on my forum. The theme creator is saying the theme doesn't mess with any ability to add widgets so I'm currently bashing my head against my desk instead of having morning coffee..

Thanks again.
 
I also added this code in my Siropu Ads Manager, to display it on the top of that particular subforum. (If you have this product, its easier)

<xf:widget key="USA_DEBT_CLOCK" />

I'm using the "ABOVE THREAD LIST" location, within Siruopu ads manager. It looks like this:

1706543760787.webp
 
Thanks for everyone's help in this thread. I finally figured out why I couldn't get it to work. It's because, I think, the page where my forum defaults to is not a place that you can put a widget at the top of. My forum defaults to here:

mainpage.webp

And because that's not one of the areas that a widget can be put at the top of.. it appears I'm SOL? Any idea on a solution or is that some kind of custom job?

Thanks again for all the help.
 
Thanks for everyone's help in this thread. I finally figured out why I couldn't get it to work. It's because, I think, the page where my forum defaults to is not a place that you can put a widget at the top of. My forum defaults to here:

View attachment 297417

And because that's not one of the areas that a widget can be put at the top of.. it appears I'm SOL? Any idea on a solution or is that some kind of custom job?

Thanks again for all the help.
This should still work, if you insert it somewhere else. (and assuming you gave the widget the same name I did)

<xf:widget key="USA_DEBT_CLOCK" />
 
This should still work, if you insert it somewhere else. (and assuming you gave the widget the same name I did)

<xf:widget key="USA_DEBT_CLOCK" />
Any idea where I would find the place to insert it? Sorry, I think I understand you but I'm trying to figure out how to edit my theme/forum background, I guess, to figure out where to insert that.

Thanks again!
 
It's a shame there's no widget position for above nodes inside categories. There only seems to be one for the main forum list index and not node lists inside categories.

We need widget positions for thread_list and category_view - above nodes.

Apparently there's an add-on that adds these positions but not in default XF.


@Chris D or @Paul B can we still request widget positions? Or just going via the usual suggestion route?
 
Back
Top Bottom