Icon on search results too

Since Opentools.de has now gone away I've created this forum to house FAQs and support for this mod in phpBB2.

Moderator: Experts

Locked
Marcus Wendel
Posts: 3
Joined: Sat Apr 28, 2007 1:19 pm

Icon on search results too

Post by Marcus Wendel »

How can I modify the phpbb-files to get the Attachment Topic Icon to be displayed on the search results as well?
Thanks.

/Marcus
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Post by DavidIQ »

A few modifications to what I had already shown you on phpBB.com:

Code: Select all

# 
#-----[ OPEN ]---------------------------------------------
# 
search.php

# 
#-----[ FIND ]---------------------------------------------
# 
         'NEWEST_POST_IMG' => $newest_post_img, 

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
         'TOPIC_ATTACHMENT_IMG' => topic_attachment_image_searchresults($searchset[$i]['topic_attachment']),

# 
#-----[ OPEN ]---------------------------------------------
# 
attach_mod/displaying.php

# 
#-----[ FIND ]---------------------------------------------
# 
	return $image;
}

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
/**
* Returns the image-tag for the topic image icon in search results
*/
function topic_attachment_image_searchresults($switch_attachment)
{
	global $attach_config, $is_auth;

	if (intval($switch_attachment) == 0 || $is_auth['auth_view'] || intval($attach_config['disable_mod']) || $attach_config['topic_icon'] == '')
	{
		return '';
	}

	$image = '<img src="' . $attach_config['topic_icon'] . '" alt="" border="0" /> ';

	return $image;
}

# 
#-----[ OPEN ]---------------------------------------------
# 
templates/subSilver/search_results_topics.tpl

# 
#-----[ FIND ]---------------------------------------------
# 
   <td class="row2"><span class="topictitle">{searchresults.NEWEST_POST_IMG}{searchresults.TOPIC_TYPE}<a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a></span><br /><span class="gensmall">{searchresults.GOTO_PAGE}</span></td>

# 
#-----[ IN-LINE FIND ]---------------------------------------------
# around line 26 (directly in that line)
{searchresults.NEWEST_POST_IMG}

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------------
# 
{searchresults.TOPIC_ATTACHMENT_IMG}
Marcus Wendel
Posts: 3
Joined: Sat Apr 28, 2007 1:19 pm

Post by Marcus Wendel »

Thanks again, I'll give it a try.

/Marcus
Marcus Wendel
Posts: 3
Joined: Sat Apr 28, 2007 1:19 pm

Post by Marcus Wendel »

Looks great, many thanks for the help.

/Marcus
Locked