Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
custom-topic
Code Customization
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 27, 2010 - 9:42 am
sp_QuotePost Quote

hesitant to go down this road because without php and css knowledge could get messy...  you will have to edit the core code...  let us know if you want to do that... we can try to give you some untested code... then you will have to style it...

Avatar
JanetBarclay
Hamilton, Ontario, Canada
Member
Free Members
sp_UserOfflineSmall Offline
Aug 27, 2010 - 10:04 am
sp_QuotePost Quote

I am comfortable with CSS and don't mind editing php code if you can tell me what to do. I'll be sure to back up first so I don't break anything. [Image Can Not Be Found]

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 28, 2010 - 8:41 am
sp_QuotePost Quote

shot in the dark here… find this query in the sf-template-tags-lists.php file, function sf_latest_posts():

$posts = sfdb_select('set',
            "SELECT post_id, topic_id, forum_id, post_content, post_index, ".sf_zone_datetime('post_date').",
             ".SFPOSTS.".user_id, guest_name, ".SFMEMBERS.".display_name FROM ".SFPOSTS."
             LEFT JOIN ".SFMEMBERS." ON ".SFPOSTS.".user_id = ".SFMEMBERS.".user_id
             ".$where."
             ORDER BY post_date DESC
             LIMIT ".$limit);

and change it to

$posts = sfdb_select('set',
            "SELECT post_id, topic_id, forum_id, post_content, post_index, ".sf_zone_datetime('post_date').",
             ".SFPOSTS.".user_id, guest_name, user_email, guestemail, ".SFMEMBERS.".display_name FROM ".SFPOSTS."
             LEFT JOIN ".SFMEMBERS." ON ".SFPOSTS.".user_id = ".SFMEMBERS.".user_id
             ".$where."
             ORDER BY post_date DESC
             LIMIT ".$limit);

and then where you want the avatar to display in that same function, add this:

if ($post->user_id)
            {
                $icon = 'user';
                if (sf_is_forum_admin($post->user_id)) $icon='admin';
            } else {
                $icon = 'guest';
            }
            $out.= sf_render_avatar($icon, $post->user_id, sf_filter_email_display($post->user_email), sf_filter_email_display($post->guestemail), false, $size);

again, this is completely untested…  you will probably want to style this to your liking... there are some threads in our forum about suggested styling for this in other tags that already allow an avatar...

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 28, 2010 - 9:59 am
sp_QuotePost Quote

@ Mr. Papa...  if we had a Karma button I'd be clicking the heck out of it right now.

^5

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 28, 2010 - 10:21 am
sp_QuotePost Quote

Cool

great idea for plugin for 5.0! 

Avatar
JanetBarclay
Hamilton, Ontario, Canada
Member
Free Members
sp_UserOfflineSmall Offline
Aug 30, 2010 - 8:59 am
sp_QuotePost Quote

The code you are telling me to replace does not exist in my sf-template-tags-lists.php file. The closest I found is this:

$posts = $wpdb->get_results(

            "SELECT post_id, topic_id, forum_id, post_content, post_index, ".sf_zone_datetime('post_date').",

             ".SFPOSTS.".user_id, guest_name, ".SFMEMBERS.".display_name FROM ".SFPOSTS."

             LEFT JOIN ".SFMEMBERS." ON ".SFPOSTS.".user_id = ".SFMEMBERS.".user_id

             ".$where."

             ORDER BY post_date DESC

             LIMIT ".$limit);

I tried replacing that with what you gave me and got a Fatal Error:

The theme has encountered a problem that it cannot recover from. Please use the following information to try to resolve the problem.

Error Code:     php_code_error:1:/problem-with-post-edit-buttonome/storage/public_html/wp-content/plugins/simple-forum/template-tags/sf-template-tags-lists.php:337:Call to undefined function sfdb_select()

Message:     A fatal code error occurred.

If you are unable to fix this problem, please copy all the text on this screen and send it to support@ithemes.com.

Debug Data:

Theme

I sincerely appreciate all the help, but even if this step had worked, "where you want the avatar to display in that same function" is not really helpful to me, since I have no idea where to paste the code to make the avatar appear on the left.

Avatar
JanetBarclay
Hamilton, Ontario, Canada
Member
Free Members
sp_UserOfflineSmall Offline
Aug 30, 2010 - 9:54 am
sp_QuotePost Quote

Sorry to be such a pain... my client may not want the avatar after all, but they are wondering if there is any way to change the order that the information is displayed, so instead of

username posted topic in forum

date

it would read:

topic in forum
posted date by username

I'm guessing there isn't, but can you please confirm?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 30, 2010 - 12:39 pm
sp_QuotePost Quote

Only in the same way - i.e., recoding it.

andy-signature.png
YELLOW
SWORDFISH
Avatar
JanetBarclay
Hamilton, Ontario, Canada
Member
Free Members
sp_UserOfflineSmall Offline
Aug 30, 2010 - 2:19 pm
sp_QuotePost Quote

This is obviously all over my head... is there anyway of paying someone to do the code customization for us? (This was actually my original intention when I posted in this forum...)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 31, 2010 - 12:00 am
sp_QuotePost Quote

its the right forum for that.  lets see if anyone responds...

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: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 618
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10120
Posts: 79607