Skip to main content
Recent Posts
Custom Themes / Re: [Theme] Separation
Last post by Burke_Knight -
Quote from: Spuds – I believe that is now fixed on my local ...  The errors were created when we moved those items (blurb, gender) to be custom fields and not standard fields.  Something I simply overlooked when I update the theme for 1.1.

I noticed at least one other error so I'll post an update in a bit,  just looking to see if I find moar !

They are still not showing on my sites.
Not sure why not. The coding is all there, maybe something in the display template that might be wrong?
Bug Reports / Re: Image preview
Last post by Spuds -
The above seems to work in my testing, however it allows the plain thumbnail size in the preview to  grow to large.  So the full fix will be

Code: (find) [Select]
		$format = setDefaultFormat($filename);
if ($resize && resizeImageFile($filename, $filename . '_thumb', 100, 100, $format))

Code: (replace) [Select]
		$max_width = $this->_req->is_set('thumb') && !empty($modSettings['attachmentThumbWidth']) ? $modSettings['attachmentThumbWidth'] : 250;
$max_height = $this->_req->is_set('thumb') && !empty($modSettings['attachmentThumbHeight']) ? $modSettings['attachmentThumbHeight'] : 250;
$format = setDefaultFormat($filename);
if ($resize && resizeImageFile($filename, $filename . '_thumb', $max_width, $max_height, $format, false, false))
Addons / Top authors
Last post by ksamochkin -
 экрана от 2022-12-03 16-55-23.png

Code: [Select]
echo ‘<header class=»category_header»>Top authors</header>’;
global $scripturl, $modSettings, $settings, $txt;

// Height and width of avatar
$width = ’40px’;
$height = ‘100%’;
// Number of top posters displayed

$topPoster = 10;

$db = database();

// Find the latest poster.
$request = $db->query(», ‘
SELECT mem.id_member, mem.show_online, mem.real_name, mem.posts, mem.avatar, a.id_attach, a.attachment_type, a.filename
FROM ({db_prefix}members as mem)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
WHERE show_online = 1 AND mem.is_activated = 1
LIMIT {int:limit}’,
array(‘limit’ => $topPoster)

$users = array();

while ($row = $db->fetch_assoc($request))
$users[] = array(
‘id’ => $row[‘id_member’],
‘name’ => $row[‘real_name’],
‘href’ => $scripturl . ‘?action=profile;u=’ . $row[‘id_member’],
‘link’ => ‘<a href=»‘ . $scripturl . ‘?action=profile;u=’ . $row[‘id_member’] . ‘»>’ . $row[‘real_name’] . ‘</a>’,
‘posts’ => $row[‘posts’],
‘show’ => $row[‘show_online’],
‘avatar’ => array(
‘image’ => empty($row[‘avatar’]) ? ($row[‘id_attach’] > 0 ? ‘src=»‘ . (empty($row[‘attachment_type’]) ? $scripturl . ‘?action=dlattach;attach=’ . $row[‘id_attach’] . ‘;type=avatar’ : $modSettings[‘custom_avatar_url’] . ‘/’ . $row[‘filename’]) . ‘» alt=»» width=»‘.$width.'» height=»‘.$height.'» title=»‘.$row[‘real_name’].'» />’ : ») : (stristr($row[‘avatar’], ‘http://’) ? ‘src=»‘ . $row[‘avatar’] . ‘» alt=»» width=»‘.$width.'» height=»‘.$height.'» title=»‘.$row[‘real_name’].'» />’ : ‘src=»‘ . $modSettings[‘avatar_url’] . ‘/’ . htmlspecialchars($row[‘avatar’]) . ‘» alt=»» width=»‘.$width.'» height=»‘.$height.'» title=»‘.$row[‘real_name’].'» />’),


// Output our array of users with avatar, posts, and name
echo ‘
<table width=100%><tr>’;

foreach ($users as $user)
echo ‘
<td>’,empty($user[‘avatar’][‘image’]) ? ‘<a href=»‘.$user[‘href’].'»><img src=»‘.$settings[‘tp_images_url’].’/TPguest.png» width=»‘.$width.'» height=»‘.$height.'» alt=»» title=»‘.$user[‘name’].'» /></a>’ : ‘<a href=»‘.$user[‘href’].'»><img ‘.$user[‘avatar’][‘image’].'</a>’;
echo ‘
<br><h5 style=»margin: 4px;»>’.$user[‘link’].'</h5><h5 style=»margin: 4px;»>’. $user[‘posts’] .’ ‘.$txt[‘posts’].'</h5></td>’;

echo ‘

Support / Re: Code block word wrap
Last post by Spuds -
The easiest way to accomplish that is to find and change the .bbc_code block in index.css file

In that specific CSS block you will find white-space: nowrap; and change that to white-space: pre-wrap;

That should give you what you are looking for.
Support / Code block word wrap
Last post by Burke_Knight -
Ok, working on a couple of sites, and ran into something.
When using the code blocks, there's the scroll bar at the bottom to slide left and right.
However, I'd like to have the block word wrapped, like in a few other sites I've worked with.
For one site, it would be a lot easier for people to check to see which code block has the right code for them to choose.

Thank you!

Bug Reports / Re: Image preview
Last post by Spuds -
Yeah ... Humm

I was only seeing the low quality image but I'm using imagick in testing, so maybe GD is different (1.1.9). 

The issue stems from those tmp files we use when in preview, they were originally intended for use in the upload area, so they are just 100px thumbnails. When they get ila'ed in preview above 100px they look horrible!

A quick fix to try is in Attachment.controller.php
Code: (find) [Select]
		if ($resize && resizeImageFile($filename, $filename . '_thumb', 100, 100, $format))
Code: (replace) [Select]
		if ($resize && resizeImageFile($filename, $filename . '_thumb', 250, 250, $format, false, false))

That will provide a larger thumbnail image for use while still remaining a very small file so things do not slow down.   Give that a test and let me know, I'm testing it as well.
Bug Reports / Image preview
Last post by radu81 -
Not sure if this is a bug, but it's sure strange.

I inserted two attachments, one jpg and one in webp format, then I choose to insert those images inline with 200 px widh. Then I use the preview button and here is what I get:

Elkarte 1.1.9:
- the preview for jpg is in low quality
- the preview for the webp is in good quality

Elkarte 2.0
- both images in preview mode are in low quality

Like I said, not sure if it's a bug and how it was supposed to work the preview, strange is that on Elkarte 1.1.9 the webp image in preview mode is displayed in a good quality. I attach the images I used and the preview I see in both versions.