Support Forum
Yep it's working!
it's missing just on "first post from" and "last post from" labels on forum lists
thank you very much! 🙂
just one little more question, as I do not fully understand you code...
in this line: $objList['cortesia'] = 'title';
if "cortesia" stands for the name of my usermeta, what "title" stands for?
title is simple a flag or switch for us... it tells us how to filter the object for display...
Visit Cruise Talk Central and Mr Papa's World
All data that is user entered needs to be filtered and sanitised to ensure there is nothing malicious in it - like an attempt to run SQL or javascript. SP has a series of display filters that does just this and ALL data is passed through the filters before being displayed or used. The reference to 'title' tells the system what filter to run that data item through and is probably the best one for your needs. It does not - for example - allow HTML tags within the data.
if you go the forum admin > toolbox > data inspector and turn on the option to display spThisUser when you run, say, the front page of the forum, it will display all of the data that is a part of our user object and you will see how the filters we changed yesterday have become a part of that object.
YELLOW
SWORDFISH
|
Ok,
I've looked forward for trying to add that usermeta in places where it is not shown with that awesome filter.
I mean in places like "last post" "topic started"
I see that datas are shown by functions like
sp_TopicIndexFirstPost
sp_TopicIndexLastPost
is there a way to filter theese as well?
This is where it gets a bit moire tricky.
You would need to use the filter on the code that builds the data object. This would give you an array of topic data along with the posts data which would include the user ID and the display name.
Your code would then need to traverse the array and change all the instances of display_name. You would need to lookup the data you want to prepend for each user as you work through the data array.
No so easy
YELLOW
SWORDFISH
|
Hi Sword,
sorry to persist bothering you with this issue, but I need some more help to achieve this.
Let's start with the "group view" screen (that I think is the forum home, right?).
Using the wonderful Data Inspector I can see that there are 3 objects in Group View Data that contain the user display name.
1) spThisForum
2) spThisGroup
3) spGroupView
Wich one would be better try to manipulate to filter display name of "last message from" in Group View?
Well it's $spThisForum at that point and the last post column has a filter defined of 'sph_ForumIndexLastPost' but that is going to contain all of the text for that display element - not just the display name.
However the 'sph_groupview_stats_records' filter will pass an array of all the data for the page (the stats data that is) which would be better. You could then loop through the array changing each instance of display_name to what you need. This filter passes two parameters - the data object we are going to use for the final display and a second parameter containing the raw data as retrieved from the database. You would want to operate ion the first of course.
YELLOW
SWORDFISH
|
1 Guest(s)