Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Custom Feeds - Based on hits and time
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 10, 2014 - 12:30 pm

Really? I will need to test that... I can just never remember the syntax for using shortcodes. I thought is was spaces...

For expediency I would suggest you go grab a plugin named WP Exec PHP from the WP plugin repository, activate it, go to the WP admin options for it and turn on the option to use in widgets - and then use the template tag in the widget.

Bit I will investigate the short code usage.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 10, 2014 - 12:35 pm

I've worked out how to add it where I want in the template if needed, I've read the codex but it doesn't explain what the number is? How does the system generate the rating? It's doesn't appear to be hits? Is it hits divided by time or something?

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 10, 2014 - 12:37 pm

Thanks for your previous reply I hadn't refreshed my screen. I was using the shortcode like this, was this wrong?

[sp_hot_topics ('days=365')]

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 10, 2014 - 12:41 pm

For the question ion Post #12 I am going to have to ask because I really do not know. So hopefully Mr Papa will dive in and tell you because he does know!

Not sure I understand question #13 though...?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 10, 2014 - 12:45 pm

Sorry I was trying to paste the code but they don't show up, do I put tags round a code to show you?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 10, 2014 - 12:49 pm

Ah - paste the code into the editor -carefully select it (only the code) and then click on the syntax button on the toolbar (far right). Choose the language, select and save.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 10, 2014 - 8:28 pm

also, where were you using the shortcode?  by defafult, wp does not process shortcodes in text widgets though you can enable it via a wp hook...

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2014 - 8:14 am

Sorry for the late reply. I was doing the shortcode like this

 

Sorry I've added the shortcode as an image as the syntax button keeps either making everything after this point code or the code disappears.

 

 shortcode.jpgImage Enlarger

As a note the shortcode is missing from your new codex page:

https://simple-press.com/docum.....ot-topics/

Also did you have an answer as to how the rating is generated? And can it be changed if the customer wants?

Thanks

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 16, 2014 - 10:32 am

There is something odd about that codex page that will be investigated for sure. Thanks for pointing it out.

Sorry to hear you have problems with the syntax button as well. Not really sure why - we use it rather a lot without any problem. But you do need to select ONLY the text you want highlighted with care to make the best of it.

I am going to defer to Steve (Mr Papa) who wrote the tag on how the rating is generated. I have just looked at the code and even i am not sure what exactly is happening in there. Depending on the answer may decide on how easy it is to change so we need to wait for that first I am afraid.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2014 - 9:18 pm

First, in wp shortcodes camel case attributes are not allowed... they must be all lowercase...from http://codex.wordpress.org/Shortcode... and if you want to display a shortcode, but not have it processed, you can escape it, or use triple brackets around it, ie [[[ and ]]]... or [gallery] (note in wp posts its only two, but we need three in the forum because wp tries to run shortcodes on our stuff after we have already)

Looks like the codex page on that template tag, assuming by rating  you still mean the sp_HotTopicsTag() function, is a bit weak since we normally list the filters available but that one does not...

anyways, you can use the 'sph_HotTopicTagScore' filter to replace the hotness equation with whatever you want...  the default equation is:

log($days - $delta)

where $days is the argument (default = 30) you pass into the function for number of days to go back looking for posts and $delta is the number of days from current date to post date...

basically, your filter would need to return the value or score for the post...  passed to your filter would be the post information and the arguments to the function...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625