vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   how to change backgorund color for attachment popup (https://vborg.vbsupport.ru/showthread.php?t=207410)

psasse 03-05-2009 08:17 AM

how to change backgorund color for attachment popup
 
Is there a way to change the background color in the popup windows for attached images?

I think this would imply a html-page being displayed instead of just the plain image. But how do i change this?

Best regards,
Matthias

Lynne 03-05-2009 02:42 PM

Find the template and then change it there. to find the template - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. Sometimes the template is the one mentioned at the very top of the page source.

psasse 03-05-2009 03:17 PM

Thank you, Lynne!

So i found this code in postbit_attachmentthumbnail, which seems to be the link used, when opening an attached image:
Code:

<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" rel="Lightbox_$post[postid]" id="attachment$attachment[attachmentid]"<if condition="$show['newwindow']"> target="_blank"</if>> thumbnail code removed</a>
So I guess I would have to make changes to attachment.php, in order to not only show the plain image, but a html-site with the image and the desired background color?

I don't know much about php, so can this be done in a few simlpe steps?

Lynne 03-05-2009 03:23 PM

I thought you wanted to change the background of the actual pop-up? If so, click on the link to pop it up and the view the page source and find the template name there.

psasse 03-05-2009 03:40 PM

Quote:

I thought you wanted to change the background of the actual pop-up? If so, click on the link to pop it up and the view the page source and find the template name there.
Yes, but if I klick the thumbnail of an attached image, a popup window opens, showing the full-sized image. But it is not a html or php page, it's just the image as if you would use a direct link to a .jpg

Lynne 03-05-2009 03:46 PM

Oh, I thought you meant the page where you do the attaching (the pop-up you get when you hit Manage Attachments). Are you using lightbox? I have no clue how to change that.

psasse 03-06-2009 08:57 AM

I'm not using Lightbox because i need the images to open in a new window.

I'm running a site for phtographers, where many image attachments are made and viewed, and people would really appreciate seeing the pictures on a dark background.

As far as i understand (and i really don't understand much about php) i would have to modify the attachment.php in a way, that is does not only send the plain image, but an .html file with my desired background color.


EDIT:
I found a solution myself :)
It's based on a simple java script, which requires the user to have JS turned on, but that would be the same with lightbox anyway.

It requires the following changes to postbit_attachmentthumbnail:

At the beginning add:
Code:

<script type="text/javascript">
function showPic(it) {
  var w = window.open("","","width="+screen.width+",height="+screen.height+",left=0,top=0,resizable=1,scrollbars=1,status=0,menubar=0,top=0,left=0");
  w.document.writeln("<body bgcolor='#333333'>");
  w.document.writeln("<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='middle'><img src='" + it + "'></td></tr>");
  w.document.writeln("<\/body>");
  w.document.close();
}
</script>

Of course you can change the bgcolor, window size etc. to anything you prefer.

And to the thumbnail-Link add:
Code:

onclick="showPic(this.href);return false"
right after the href="..."

Lynne 03-06-2009 02:01 PM

Ah, good sleuthing! :up:


All times are GMT. The time now is 04:49 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01991 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete