Log in

View Full Version : Display images in archive?


v123shine
09-29-2011, 03:08 AM
Hello..

Now all of images show as link in vbulletin archive. Can someone help me to show images in archive?

I see some of vbulletin forum can show image in archive. I try to search the mod but i cant find.

- Please help me -
Thank you so much

v123shine
09-30-2011, 03:17 AM
Help me, please!!

v123shine
10-01-2011, 06:01 PM
I need help, please!!

BirdOPrey5
10-02-2011, 03:39 PM
Do you have a link to a forum that shows images in the archive?

v123shine
10-03-2011, 02:34 AM
Thank you so much 'BirdOPrey5' for respone my question.

Yes of course I have.

BirdOPrey5
10-03-2011, 10:09 AM
Wow that is very custom, at first I wasn't even sure it was a VB forum but it is. However it completely defeats the entire purpose of having an archive to begin with- why not just disable your archive if that is what you want?

v123shine
10-04-2011, 04:34 AM
Dear BirdOPrey5,

I need the archive. Many people search in google and found the archive page / not original page, and they dont know how to open original page :( -- So i need to display image in archive, but in default vbulletin archive user can't view image/photo.

Can you help me to build the small plugin for display image in archive, please!

BirdOPrey5
10-04-2011, 01:33 PM
I can't get it t work as a plugin, but if you edit your index.php file in the archive:

Find this code:


while ($post = $db->fetch_array($posts))
{
$i++;
$post['pagetext_simp'] = strip_bbcode($post['pagetext']);
$post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline']);
$post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);

if ($vbulletin->options['wordwrap'] != 0)
{
$post['pagetext_simp'] = fetch_word_wrapped_string($post['pagetext_simp']);
}

$post['pagetext_simp'] = fetch_censored_text($post['pagetext_simp']);

($hook = vBulletinHook::fetch_hook('archive_thread_post')) ? eval($hook) : false;

$output .= "\n<div class=\"post\"><div class=\"posttop\"><div class=\"username\">$post[username]</div><div class=\"date\">$post[postdate], $post[posttime]</div></div>";
$output .= "<div class=\"posttext\">" . nl2br(htmlspecialchars_uni($post['pagetext_simp'])) . "</div></div><hr />\n\n";
}

}



and replace with:


while ($post = $db->fetch_array($posts))
{
$i++;
$post['pagetext_simp'] = strip_bbcode($post['pagetext']);
$post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline']);
$post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);

if ($vbulletin->options['wordwrap'] != 0)
{
$post['pagetext_simp'] = fetch_word_wrapped_string($post['pagetext_simp']);
}

$post['pagetext_simp'] = fetch_censored_text($post['pagetext_simp']);

($hook = vBulletinHook::fetch_hook('archive_thread_post')) ? eval($hook) : false;

require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),true);

$post['pagetext_simp'] = $bbcode_parser->parse($post['pagetext'] , $threadinfo['forumid'] , false);

$output .= "\n<div class=\"post\"><div class=\"posttop\"><div class=\"username\">$post[username]</div><div class=\"date\">$post[postdate], $post[posttime]</div></div>";
$output .= "<div class=\"posttext\">" . nl2br(($post['pagetext_simp'])) . "</div></div><hr />\n\n";
}

}


It should parse your images, and other bbcode.

v123shine
10-04-2011, 01:38 PM
Thank you so much BOP5

OC, I will try now :)

--------------- Added 1317743876 at 1317743876 ---------------

Dear BOP5,

unregister member (user not login) cant view the photo, but register member (user already login) can view the photo.

please help me to show image to unregister member...

--------------- Added 1317746246 at 1317746246 ---------------

Update:
All thread content empty in archive!

This is the preview vbulletin archive for member not login >>> all thread content empty, but if member login, member can view all thread content and images.

v123shine
10-06-2011, 03:49 AM
Help me, please.

v123shine
10-07-2011, 11:35 AM
I need your help, please!!

BirdOPrey5
10-07-2011, 03:12 PM
Do you have images turned off for guests? In my forum I can see the images as a guest when I tested this.

Maybe check the file edits again.

v123shine
10-07-2011, 04:59 PM
This for Guest :
https://vborg.vbsupport.ru/external/2011/10/55.jpg

This print screen for Register member :
https://vborg.vbsupport.ru/external/2011/10/56.jpg

Please help me BirdOPrey5

--------------- Added 1318010552 at 1318010552 ---------------

This is my index.php file content.



// ************************************************** ******************************************
// display thread

if ($do == 'thread')
{
if (!$vbulletin->options['archive_threadtype'])
{
// if we are not using the archive threadtype, invisibly redirect to the full thread view
exec_header_redirect($vbulletin->options['bburl'] . "/showthread.php?" . $vbulletin->session->vars['sessionurl_js'] . "t=$threadinfo[threadid]");
}

if ($vbulletin->options['wordwrap'] != 0)
{
$threadinfo['title'] = fetch_word_wrapped_string($threadinfo['title']);
}

$threadinfo['title'] = fetch_censored_text($threadinfo['title']);

$output .= print_archive_navigation($foruminfo, $threadinfo);

$output .= "<p class=\"largefont\">$vbphrase[view_full_version] : "
. ($threadinfo['prefix_plain_html'] ? "$threadinfo[prefix_plain_html] " : '' )
. "<a href=\"" . $vbulletin->options['bburl'] . "/showthread.php?t=$threadinfo[threadid]\">$threadinfo[title]</a></p>\n<hr />\n";

if ($p == 0)
{
$p = 1;
}

$output .= print_archive_page_navigation($threadinfo['replycount'] + 1, $vbulletin->options['archive_postsperpage'], "t-$threadinfo[threadid]");

$posts = $db->query_read_slave("
SELECT post.postid, post.pagetext, IFNULL( user.username , post.username ) AS username, dateline
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = post.userid)
WHERE threadid = $threadinfo[threadid]
AND visible = 1
$globalignore
ORDER BY dateline ASC
LIMIT " . (($p - 1) * $vbulletin->options['archive_postsperpage']) . ',' . $vbulletin->options[archive_postsperpage]
);
if ($pda AND false)
{
$output .= "<span id=\"posting\"><a href=\"?message=1\" rel=\"nofollow\">New Reply</a></span>";
}
$i = 0;



while ($post = $db->fetch_array($posts))
{
$i++;
$post['pagetext_simp'] = strip_bbcode($post['pagetext']);
$post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline']);
$post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);

if ($vbulletin->options['wordwrap'] != 0)
{
$post['pagetext_simp'] = fetch_word_wrapped_string($post['pagetext_simp']);
}

$post['pagetext_simp'] = fetch_censored_text($post['pagetext_simp']);

($hook = vBulletinHook::fetch_hook('archive_thread_post')) ? eval($hook) : false;

require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),true);

$post['pagetext_simp'] = $bbcode_parser->parse($post['pagetext'] , $threadinfo['forumid'] , false);

$output .= "\n<div class=\"post\"><div class=\"posttop\"><div class=\"username\">$post[username]</div><div class=\"date\">$post[postdate], $post[posttime]</div></div>";
$output .= "<div class=\"posttext\">" . nl2br(($post['pagetext_simp'])) . "</div></div><hr />\n\n";
}

}

v123shine
10-09-2011, 02:13 AM
help me, please!!

BirdOPrey5
10-09-2011, 09:24 AM
1st) You are not allowed to post entire files, it is a copyright violation. Only post the relevant part of the file.

2) Do not "QUOTE" it, if you post code use the [CODE] or [PHP] BB Code tags, not [QUOTE].

3) You did not answer my question asked in post #12, can guests view posts and images in your normal forum because that is the only reason I can think it isn't working.

You code changes look correct.

ALSO- if you have any plugins you made trying to do this, or any plugins on the hook "archive_thread_post" - disable them.

v123shine
10-09-2011, 05:58 PM
1) You are not allowed to post entire files, it is a copyright violation. Only post the relevant part of the file.
# I'm so sorry for something stupid that I do. I promised not to repeat it again. Sorry!!

The problem come from plugin in "archive_thread_post", after disable that plugin, guest can view photo :):)
Thank you so much BirdOPrey5 for help me.

BirdOPrey5
10-09-2011, 06:27 PM
Glad it is working...

You do not need to post everything in [code], only actual code. ;)