Opening a new window while in wrapper

Discuss the universal connector for forums and other applications. (including vBridge )
Locked
Spaz
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Oct 17, 2005 6:33 pm

Opening a new window while in wrapper

Post by Spaz » Fri Nov 18, 2005 2:56 pm

My forums is using the wrapper,  but when a user opens a topic in a new tab / windows it shows vb outside the wrapper is there any way i can detect this and keep it inside the wrapper.

chockers
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Mon Nov 14, 2005 3:57 pm

Re: Opening a new window while in wrapper

Post by chockers » Fri Nov 18, 2005 3:55 pm

not really man, as when its wrapped its just the forum being put within a space allocated on your page..

it doesnt actualy change the links of the forum.. which would be needed for your question..

however you could disable right click, which would stop people openin in a new window.. but then they could hold a button and press the link, but either way if people want to open in a new window.. u cant stop them.. lol
www.solutions3.com.au Joomla-Vbulletin intergration scripts and installation! Get it done best from the guys down under!

Spaz
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Oct 17, 2005 6:33 pm

Re: Opening a new window while in wrapper

Post by Spaz » Fri Nov 18, 2005 6:46 pm

I just had a thought, maybe preditor can help me out with this, what if I changed the links from vb to use the link from the bridge eg.
with my vba gallery i call it by saying
index.php?option=com_vbridge&Itemid=33&file=gallery/index.php

so in my test when i modify that link to be
index.php?option=com_vbridge&Itemid=33&file=forumdisplay.php?f=2

it works and its in the wrapper. So all i need to do is have vb make all links to have index.php?option=com_vbridge&Itemid=33&file= before the original.

so i theory that will produce the links i want so no matter what the users do it is always in the wrapper.
hope you understand what i am saying.

chockers
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Mon Nov 14, 2005 3:57 pm

Re: Opening a new window while in wrapper

Post by chockers » Fri Nov 18, 2005 7:43 pm

or there i that method.. it would require u to find where it is in which file.. but its doable, but a long process.. however if u did find out plz let the community know.. it would be a good addition to the release
www.solutions3.com.au Joomla-Vbulletin intergration scripts and installation! Get it done best from the guys down under!

User avatar
Predator
Joomla! Ace
Joomla! Ace
Posts: 1827
Joined: Wed Aug 17, 2005 10:12 pm
Location: Germany-Bad Abbach
Contact:

Re: Opening a new window while in wrapper

Post by Predator » Fri Nov 18, 2005 9:38 pm

A replace function was included in the older versions, to have this also for vB 3.5.x

in foum/includes/functions.php at line 4241-4244 after

Code: Select all

if ($vbulletin->debug AND $debughtml != '')
	{
		$vartext = str_replace('</body>', "<!--start debug html-->$debughtml<!--end debug html-->\n</body>", $vartext);
	}

add:

Code: Select all

//<!-- Begin Joomla-vBridge from WH-SOLUTION -->
$vbconfig = $vbulletin->db->query_first("SELECT * FROM ".MOS_PREFIX."vbridge_config WHERE id='1'");

if ($vbconfig['wrapped'] == 1 ) {

$Itemid = $vbulletin->db->query_first("SELECT id FROM ".MOS_PREFIX."menu WHERE link='index.php?option=com_vbridge' AND published='1'");
$mosurl = MOS_URL."/index.php?option=com_vbridge&Itemid=".$Itemid['id']."&file=";
$vartext = str_replace("php?","php&", $vartext);
$vartext = str_replace("index.php&","index.php", $vartext);
$vartext = str_replace("&&","?", $vartext);
$vartext = str_replace("&buddies=","", $vartext);
$vartext = str_replace("&option","?option", $vartext);
$vartext = str_replace("attachment.php&","attachment.php?", $vartext);
$vartext = str_replace("image.php&","image.php?", $vartext);
$vartext = str_replace("online.php&order","online.php?order", $vartext);
$vartext = str_replace("online.php&","online.php", $vartext);
$vartext = str_replace('href="', 'href="'.$mosurl.'',$vartext);
$vartext = str_replace('href="'.$mosurl.'online.php','href="online.php',$vartext);
$vartext = str_replace('URL=', 'URL='.$mosurl.'',$vartext);
$vartext = str_replace('URL='.$mosurl.'misc.php&', 'URL=misc.php?',$vartext);
$vartext = str_replace('window.location = "', 'window.location = "'.$mosurl.'',$vartext);
$vartext = str_replace("window.location = '", "window.location = '".$mosurl."",$vartext);
$vartext = str_replace('window.location="', 'window.location="'.$mosurl.'',$vartext);
$vartext = str_replace("window.open('", "window.open('$mosurl",$vartext);
$vartext = str_replace('window.open("', 'window.open("'.$mosurl.'',$vartext);
$vartext = str_replace('openWindow("private.php&','openWindow("private.php?',$vartext);
$vartext = str_replace('img_obj.src = "', 'img_obj.src = "'.$mosurl.'',$vartext);
$vartext = str_replace('<form action="report.php', '<form action="'.$mosurl.'report.php',$vartext);
$vartext = str_replace("opener.location=('", "opener.location=('$mosurl",$vartext);
$vartext = str_replace('opener.location=("', 'opener.location=("'.$mosurl.'',$vartext);
$vartext = str_replace('opener.location="', 'opener.location="'.$mosurl.'',$vartext);
}
//<!-- End Joomla-vBridge -->
Last edited by Predator on Fri Nov 18, 2005 11:04 pm, edited 1 time in total.
The "Humor, Fun and Games" forum has  more than 2500 Posts, so why not build a "Humor, Fun and Games Working" Group?
.....
Malicious tongues say we have this WG right from the start, they call it core team :D

Spaz
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Oct 17, 2005 6:33 pm

Re: Opening a new window while in wrapper

Post by Spaz » Fri Nov 18, 2005 10:28 pm

Yer, it works one error though

Code: Select all

$vbconfig = $DB_site->query_first("SELECT * FROM ".MOS_PREFIX."vbridge_config WHERE id='1'");
should be

Code: Select all

$vbconfig = $vbulletin->db->query_first("SELECT * FROM ".MOS_PREFIX."vbridge_config WHERE id='1'");
Thanx  ;D

edit. grrr
My gallery links dont work with it, but now that I know what 2 do i will try and figure it out, i just need to figure out which links come from the gallery and make the change to $mosurl = MOS_URL."/index.php?option=com_vbridge&Itemid=".$Itemid['id']."&file="; 
to include file=gallery/

will let yall know how i did.
Last edited by Spaz on Fri Nov 18, 2005 10:35 pm, edited 1 time in total.

Spaz
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Oct 17, 2005 6:33 pm

Re: Opening a new window while in wrapper

Post by Spaz » Sun Nov 20, 2005 2:59 pm

OK, I cant seem to figure this out, need some expert help with it, just to recap I am using vbAdvanced Gallery along with the vBridge now I applied the code preditor left, and It works nice for the forum, but because the gallery is in a subdir the links dont match.
eg index.php?option=com_vbridge&Itemid=33&file=browseimages.php&c=2 should be
index.php?option=com_vbridge&Itemid=33&file=gallery/browseimages.php&c=2.
I tried doing the strReplace but its hard knowing which is from gallery etc.
eg.
//Gallery Replacements
$vartext = str_replace("browseimages.php","gallery/browseimages.php", $vartext);
$vartext = str_replace("displayimage.php","gallery/displayimage.php", $vartext);
$vartext = str_replace("ecard.php","gallery/ecard.php", $vartext);
$vartext = str_replace("editimage.php","editimage.php", $vartext);
$vartext = str_replace("managecats.php","gallery/managecats.php", $vartext);
$vartext = str_replace("upload.php","gallery/upload.php", $vartext);
$vartext = str_replace("showimage.php","gallery/showimage.php", $vartext);
//$vartext = str_replace("misc.php","gallery/misc.php", $vartext);
$vartext = str_replace("newreply.php","gallery/newreply.php", $vartext);
$vartext = str_replace("moderate.php","gallery/moderate.php", $vartext);
works but I cant uses it for say search.php because it would messup the search for the forums aswell
if any experts got the time to give this problem some thought would be appricated, because I cant see how to make it work.
Thanx
Last edited by Spaz on Sun Nov 20, 2005 3:46 pm, edited 1 time in total.

ocWikiSysop
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Thu Feb 22, 2007 3:51 pm

Re: Opening a new window while in wrapper

Post by ocWikiSysop » Mon Jun 04, 2007 11:13 pm

I'm interested in doing this exact same thing under 3.6.5. I've tried adding the above code to a clean VB install and all I get is a db crash. Does anyone have update code for this?


Locked

Return to “com_connector - Multi Joomla Bridge”