java script in News und Encyclopedia Mod
-> Hilfe

#1: java script in News und Encyclopedia Mod Autor: LisaSWohnort: BGL BeitragVerfasst am: 28.12.2004 16:22
    ----
Ich möchte in die News- und Encyclopedia-Module javascript einbauen,
wie z.B. popup Fenster bei Klick auf Thumbnail.

Im News-Mod von phpNuke funktionierte mein verwendetes JS noch -
im CPG modifizierten News-Mod funktionierts nicht mehr. traurig

(Bin auch noch auf der Suche, ob ich das Problem in php lösen kann....)

zwinker

#2: Re: java script in News und Encyclopedia Mod Autor: ErtanWohnort: Germany BeitragVerfasst am: 03.01.2005 19:06
    ----
java => includes/javascript.php einbauen zwinker

#3: Re: java script in News und Encyclopedia Mod Autor: LisaSWohnort: BGL BeitragVerfasst am: 05.01.2005 15:20
    ----
aah... sehr glücklich hatte mir schon nen Wolf gesucht. zwinker

bin ja noch Newbie in Sachen php programmieren - eh klar funktioniert das nich sooo einfach... schüchtern
Da fehlt sicher noch was...?!

Hab das folgende Script in die includes/javascript.php eingebaut.
Array:
    echo "<script type=\"text/javascript\">\n";
    echo "<!--\n";
    echo " function Zoom(imgName,imgWidth,imgHeight) {\n";

    echo " zoomWindow = window.open('', 'zoomWin', 'width='+imgWidth+',height='+imgHeight+'top=10,left=5,toolbar=0,menubar=0,location=0,scrollbars=0')
zoomWindow.document.write(\"<html><head><title>Loading Image, Please Wait...<\/title><\/head><body background='/images/zoombg.gif' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 text='\",imgWidth,imgHeight,\"'><center><a href='#' onClick =javascript:window.close()><img src='\",imgName,\"' alt='Click to Close' border='0'><\/a><\/center><\/body><\/html>\")
zoomWindow.focus()
zoomWindow.window.resizeTo(imgWidth+8, imgHeight+29);
zoomWindow.document.title = \" NEWS \")\n";
    echo "}\n";
    echo "//-->\n";
    echo "</SCRIPT>\n\n";
}

Sorry, Demolink geht im Moment noch nicht, da PW geschützt.
Sobald die Seiten online sind, stell ich sie mal vor. zwinker

#4: Re: java script in News und Encyclopedia Mod Autor: ErtanWohnort: Germany BeitragVerfasst am: 05.01.2005 21:22
    ----
wie ist original javascript ?;-)

#5: Re: java script in News und Encyclopedia Mod Autor: LisaSWohnort: BGL BeitragVerfasst am: 06.01.2005 13:43
    ----
hmm... das komplette script sieht eigentlich so aus:

Array:
<script language="JavaScript">

<!--
// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
// *** BROWSER VERSION ***
// Note: On IE5, these return 4, so use is_ie5up to detect IE5.
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
// Note: Opera and WebTV spoof Navigator.  We do strict client detection.
// If you want to allow spoofing, take out the tests for opera and webtv.
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
(agt.indexOf("; nav") != -1)) );
var is_nav6 = (is_nav && (is_major == 5));
var is_nav6up = (is_nav && (is_major >= 5));
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up  = (is_ie && (is_major >= 4));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

// *** PLATFORM ***
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1); 

function EditPageOnLoad() {
// if ( document.forms.length == 0 ) return;
// formfields.Add(new validatedfield(form1.FirstName, 's', 'First Name', true));
}

function namosw_goto_byselect(sel, targetstr)
{
var index = sel.selectedIndex;
if (sel.options[index].value != '') {
if (targetstr == 'blank') {
window.open(sel.options[index].value, 'win1');
} else {
var frameobj;
if (targetstr == '') targetstr = 'self';
if ((frameobj = eval(targetstr)) != null)
frameobj.location = sel.options[index].value;
}
}
}

function Zoom(imgName,imgWidth,imgHeight) {

zoomWindow = window.open('', 'zoomWin', 'width='+imgWidth+',height='+imgHeight+'top=10,left=5,toolbar=0,menubar=0,location=0,scrollbars=0')
zoomWindow.document.write("<html><head><title>Loading Image, Please Wait...<\/title><\/head><body background='/images/zoombg.gif' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 text='",imgWidth,imgHeight,"'><center><a href='#' onClick =javascript:window.close()><img src='",imgName,"' alt='Click to Close' border='0'><\/a><\/center><\/body><\/html>")
zoomWindow.focus()
zoomWindow.window.resizeTo(imgWidth+8, imgHeight+29);
zoomWindow.document.title = " NEWS "

}
// -->
<!--
if (document.layers) {
origWidth = innerWidth;
origHeight = innerHeight;
}

function reloadPage() {
if (innerWidth != origWidth || innerHeight != origHeight) 
location.reload();
}

if (document.layers) onresize = reloadPage;
// -->

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);

}}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//-->
<!-- hide from JavaScript-challenged browsers
function openRadio(filename) {
popupWin = window.open(filename, 'f', 'status=no,resizable=no,width=410,height=230,scrollbars=no')
}
// done hiding -->
</script>	

<script>
var a = Math.random(); 
var zzzzadslotzzzz= a * 100000;
</script>

Ich dachte, dass die PopUp Fenster Funktion im function Zoom(imgName,imgWidth,imgHeight)-Teil des Scripts passiert,
da die Links im Dokument so aussehen: <a href="javascript:Zoom('xy/xy/xy.jpg',640,480)"><img src="...."></a>

Oder lieg ich da auch falsch?! schockiert

#6: Re: java script in News und Encyclopedia Mod Autor: ErtanWohnort: Germany BeitragVerfasst am: 06.01.2005 14:28
    ----
habe es hier mal zum testen eingebaut:
[url]
<a href="javascript:Zoom('http://www.cpgnuke.de/data4u/uploads/images.jpg',640,480)"><img width="45" vspace="0" hspace="0" border="0" src="http://www.cpgnuke.de/data4u/uploads/images.jpg" alt="Bezirke.gif" /></a>[/url]

in includes/javascript.php/ ganz unten nach ?> einfügen :
Array:
<script language="JavaScript"> 

function Zoom(imgName,imgWidth,imgHeight) {
zoomWindow = window.open('', 'zoomWin', 'width='+imgWidth+',height='+imgHeight+'top=10,left=5,toolbar=0,menubar=0,location=0,scrollbars=0')
zoomWindow.document.write("<html><head><title>Loading Image, Please Wait...<\/title><\/head><body background='/images/zoombg.gif' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 text='",imgWidth,imgHeight,"'><center><a href='#' onClick =javascript:window.close()><img src='",imgName,"' alt='Click to Close' border='0'><\/a><\/center><\/body><\/html>")
zoomWindow.focus()
zoomWindow.window.resizeTo(imgWidth+8, imgHeight+29);
zoomWindow.document.title = " NEWS "
}
 </script>

#7: Re: java script in News und Encyclopedia Mod Autor: LisaSWohnort: BGL BeitragVerfasst am: 06.01.2005 14:41
    ----
Juuuhuuuu! Es funktioniert!

:elefant:

@Ertan: Fettes Dankeschön!!! Herr Grün



-> Hilfe

Alle Zeitangaben sind in GMT + 1 Stunden

Seite 1 von 1