|
|
Latest News |
Latest Threads |
|
 |
56.052 Posts & 4.945 Themen in 78 Foren |
|
|
|
 |
Forensuche |
|
Suchbegriff |
Benutzerauswahl |
Ergebnisse anzeigen |
 |
Suchergebnisse |
9 Treffer |
|
 |
Verfasst am 08.07.2009 - 20:41 Forenbeitrag von: burtb_5544 |
|
Javascript bei BBCodes
Guten Tag!
Mir ging die Sicherheitsmeldung des IE auf die Nerven, wenn man per BBCode einen Link einfügen oder ne EMail Addi angeben will.
Also hab ich was zusammengebastelt was auch so weit funktioniert, bis auf eine Sache 
Die Übernahme von selektiertem Text, z.B. Linkname funktioniert nicht.
Aufgerufen wird die Funktion showPrompt() im Template format_text.
Die main.js :
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | | Quellcode ie5=(document.getElementById&&document.all&&document.styleSheets)?1:0;
nn6=(document.getElementById&&!document.all)?1:0;
promptWidth=330;
promptHeight=200;
// *** Text bei der Eingabeaufforderung ***********
linkname = "Geben Sie bitte den Linknamen an (optional).";
linkadresse = "Geben Sie bitte die vollständige Adresse des Links an.";
emailname = "Geben Sie bitte die E-Mail-Adresse ein.";
listentyp = "Für eine numerierte Liste geben Sie eine '1' an. Für eine alphabetische ein 'a'.\nFür eine einfache Punktliste drücken Sie ok.";
listenwerte = "Geben Sie bitte die Listenpunkte ein und drücken Sie anschliessend ok.\nAlternativ können Sie 'Abbrechen' wählen, um die Liste direkt fertigzustellen.";
promptTitle="<p align='center'><b>Eingabeaufforderung</b></p>";
//**** Pop-Fenster **********
function helpwindow(w,h,e) {
window.open("include.php?path=popup&mode=help&explain="+e,"helpwindow","toolbar=no,scrollbars=yes,resizable=yes,status=no,width="+w+",height="+h);
}
function smiliewindow(w,h) {
window.open("include.php?path=popup&mode=smilies&window_w_size="+w+"&window_h_size="+h,"smilies","toolbar=no,scrollbars=yes,resizable=yes,status=no,width="+w+",height="+h);
}
function finduserID(w,h) {
window.open("include.php?path=popup&mode=finduser&window_w_size="+w+"&window_h_size="+h,"finduser","toolbar=no,scrollbars=yes,resizable=yes,status=no,width="+w+",height="+h);
}
function checkall(status,theelement) {
for (i=0;i<document.myform.length;i++) {if(document.myform.elements[i].name=="" + theelement + "[]") document.myform.elements[i].checked=status;}
}
ondblclick="pkBBSelection(this);";
/*bbcode*/
var pkBBArea=null;
var pkBBSelected='';
function pkBBFocus()
{
pkBBArea.focus();
}
/*textselection*/
function pkBBSelection(obj)
{
pkBBArea=obj;
if(window.getSelection)
pkBBSelected=pkBBArea.value.substring(pkBBArea.selectionStart,pkBBArea.selectionEnd);
else if(document.getSelection)
pkBBSelected=pkBBArea.value.substring(pkBBArea.selectionStart,pkBBArea.selectionEnd);
else if(document.selection)
pkBBSelected=document.selection.createRange().text;
if(pkBBArea.createTextRange)
pkBBArea.caretPos=document.selection.createRange().duplicate();
return true;
}
function pkBBSingle(text)
{
text=' '+text+' ';
pkBBCodeAdd(text);
}
function pkBBCodeAdd(text)
{
if(pkBBArea==null)
{
pkBBArea=document.getElementById('pkBBArea');
pkBBFocus();
pkBBSelection(pkBBArea);
}
if(window.getSelection)
{
pos=pkBBArea.selectionStart + text.length;
pkBBArea.value=pkBBArea.value.substr(0,pkBBArea.selectionStart) + text + pkBBArea.value.substr(pkBBArea.selectionEnd);
pkBBArea.selectionStart=pos;
pkBBArea.selectionEnd=pos;
}
else if(pkBBArea.createTextRange && pkBBArea.caretPos)
{
var caretPos = pkBBArea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1)==' ' ? text + ' ' : text;
}
else
pkBBArea.value+=text
pkBBFocus();
}
function pkBBCode(bbcode)
{
text=(pkBBSelected) ? pkBBSelected : '';
text="["+bbcode+"]"+text+"[/"+bbcode+"]";
pkBBCodeAdd(text);
pkBBFocus();
}
/*link and email*/
nameValue=(pkBBSelected) ? pkBBSelected : '';
wertValue="http://";
//okButton
function okPrompt() {
if( (document.promptform.wert.value != null) && (document.promptform.wert.value != "") && (document.promptform.wert.value != wertValue) ) {
if((document.promptform.name.value != null) && (document.promptform.name.value != "")) {
auswahltext = "+document.promptform.wert.value+"" class="hidelink" target="_blank">"+document.promptform.name.value+" ";
pkBBCodeAdd(auswahltext);
abortPrompt();
}
else {
auswahltext = "+document.promptform.wert.value+"" class="hidelink" target="_blank">"+document.promptform.wert.value+" ";
pkBBCodeAdd(auswahltext);
abortPrompt();
}
}
}
//Abbruch
function abortPrompt() {
document.getElementById("prompt").style.top=-500;
document.promptform.name.value="";
document.promptform.wert.value=wertValue;
}
//Fenster generieren
if(ie5||nn6) {
if(ie5) cs=2,th=30;
else cs=0,th=20;
document.write(
"<div style='position:absolute;top:-500;left:0;z-index:100' id='prompt'>"+
"<table style='border-style utset;border-width:2;border-color:#E6E6CD;background-color:#F5F5DC' cellpadding='5' cellspacing='"+cs+"' width='"+promptWidth+"' height='"+promptHeight+"'>"+
"<tr><td height='"+th+"' bgcolor='#DEDEC5' align='center'>"+promptTitle+"</td></tr>"+
"<form name='promptform' onsubmit='okPrompt();return false'>"+
"<tr><td align='center'><br>"+linkname+"<br><input type='text' size='35' value='"+nameValue+"' name='name'></td></tr>"+
"<tr><td align='center'><br>"+linkadresse+"<br><input type='text' size='35' value='"+wertValue+"' name='wert'></td></tr>"+
"<tr align='center'><td><br><input type='button' value=' OK ' onclick='okPrompt()' onfocus='if(this.blur)this.blur()'>"+
" "+
"<input type='button' value='Abbrechen' onclick='abortPrompt()' onfocus='if(this.blur)this.blur()'>"+
"</form></td></tr></table></div>"
);
}
xPromptStart=100
yPromptStart=100;
function showPrompt() {
if(ie5||nn6) {
moveStatus=0;
xPrompt=xPromptStart, yPrompt=yPromptStart;
if(ie5) {
document.getElementById("prompt").style.left=xPrompt+document.body.scrollLeft;
document.getElementById("prompt").style.top=yPrompt+document.body.scrollTop;
}
else if(nn6) {
document.getElementById("prompt").style.left=xPrompt+window.pageXOffset;
document.getElementById("prompt").style.top=yPrompt+window.pageYOffset;
}
document.promptform.focus();
}
}
//Original
function pkBBLink(bbcode)
{
text=(pkBBSelected) ? pkBBSelected : '';
linktext = prompt(linkname,text);
var fensterausgabe;
if (bbcode == "URL") {
ausgabe = linkadresse;
ausgabeinhalt = "http://";
}
else {
ausgabe = emailname;
ausgabeinhalt = "";
}
linkurl = prompt(ausgabe,ausgabeinhalt);
if ((linkurl != null) && (linkurl != "")) {
if ((linktext != null) && (linktext != "")) {
auswahltext = "["+bbcode+"="+linkurl+"]"+linktext+"[/"+bbcode+"] ";
pkBBCodeAdd(auswahltext);
}
else{
auswahltext = "["+bbcode+"]"+linkurl+"[/"+bbcode+"] ";
pkBBCodeAdd(auswahltext);
}
}
}
/* list */
function pkBBList()
{
listtype=prompt(listentyp,'');
if((listtype == "a") || (listtype == "1"))
{
mylist = "[list="+listtype+"]\n";
listend = "[/list="+listtype+"] ";
}
else
{
mylist = "<ul>\n";
listend = "</ul> ";
}
listentry="initial";
while((listentry!="") && (listentry != null))
{
listentry=prompt(listenwerte,'');
if((listentry!='') && (listentry != null))
mylist = mylist+"[li]"+listentry+"[/li]\n";
}
pkBBCodeAdd(mylist+listend);
}
| |  |
Kann mir da einer helfen? |
|
|
|
|
|
 |
Verfasst am 08.05.2009 - 20:23 Forenbeitrag von: burtb_5544 |
|
Login per Link
Zitat Genauso wenig die Cookies eine Wirkung hätten, da diese im Grunde nur für das Zeitlimit und das eingelogt sein, wenn man zu einen späteren Zeitpunkt die Seite wieder betritt. |
Der Aufbau des Strings vom Cookie einlesen wäre interessant, da könnte was gehen. Allerdings ist da auch ne Session ID drin, die evtl. Einfluss haben könnte......
Die Sache mit dem Registrierungslink hatte ich auch schon im Kopf. Die Art von Loginlink wird aber nur verarbeitet, wenn die UID gesetzt ist. Diese wiederum ist nur dazu da um den User zu authentifizieren und wird beim Firstlog gelöscht...
Ist auch nicht so wichtig, ich könnte ja auch ein Script schreiben (auf das nur bedingt zugegriffen werden darf) und dann eine Session in die DB packen oder so ähnlich. Aber ich will nix modden  |
|
|
|
|
|
 |
Verfasst am 08.05.2009 - 00:56 Forenbeitrag von: burtb_5544 |
|
Login per Link
Bin da grad auf etwas gestossen:
Wenn man eingeloggt ist sind ja die Daten, die auch im Cookie gespeichert sind global verfügbar. Zum einen im _REQUEST und zum anderen in der DB als Session. Somit kann ich die Sache wohl haken ohne die login.php zu modden, es sein denn ich bekomme per $_POST eine Session gestartet....
Erstmal danke für die Aufmerksamkeit |
|
|
|
|
|
 |
Verfasst am 07.05.2009 - 19:45 Forenbeitrag von: burtb_5544 |
|
Login per Link
Es geht nicht generell um alle Accounts, sondern speziell um einen den ich für Google erstellen würde.
Es gibt dort (beim AdSense glaube ich) eine Option um dem Crawler Inhalte zugänglich zu machen, die nur mit Login abrufbar sind.
Das wollte ich mal antesten... |
|
|
|
|
|
|
 |
Verfasst am 20.12.2008 - 18:53 Forenbeitrag von: burtb_5544 |
|
Eure Computer & deren Leistung
:D
Microsoft® Windows VistaT Ultimate SP1 64bit (Windows L.I. 5,5)
Asus P5N32-E SLI
Intel Core2 Extreme Q6850@3Ghz (Quadcore)
4GB RAM 800Mhz
NVIDIA GeForce 8800Ultra 768MB
2x 500GB RAID Festpladde
2x Lan 1G / 100MB
DVD Kokeler
Logitech Maus + KB
19" BENQ Glotze
3 Jahre Finanzierung Lol... |
|
|
|
|
|
|
 |
Verfasst am 28.08.2008 - 13:46 Forenbeitrag von: burtb_5544 |
|
Problem mit BBCode Parse
Hallo!
Ich habe mir von Musel BBcode Parse heruntergeladen. Dies ist für PHPKIT 1.6.1.
Da ich aber die 1.6.4 im Einsatz habe, hab ich den Inhalt der lib_parse.php nach bbcode.php kopiert und angepasst.
Funktioniert auch super bis auf die Ausgabe einiger Zeichen:
so is original:
Zitat eval("\$config_do.= \"".pkTpl("config_all")."\";");
site_mail_htm='".$SQL->f($_POST['site_mail_htm'])."'"); |
und so die ausgabe:
Zitat eval("\$config_do.= \"".pkTpl("config_all")."\";");
site_mail_htm='".$SQL->f($_POST['site_mail_htm'])."' |
Kann mir jm. helfen das Problem zu lösen? Scheint mit der Funktion get_html_translation_table(HTML_ENTITIES); zusammen zu hängen...
Die letzten Zeilen der bbcode.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | | PHP-Quelltext function code_check($text) {
$pattern="/\[PHP](.*)\[\/PHP\]/esiU";
while(preg_match($pattern,$text)) {
$text=preg_replace($pattern,"highlight_phpcode('\\1')",$text); }
$pattern="/\[CODE](.*)\[\/CODE\]/esiU";
while(preg_match($pattern,$text)) {
$text=preg_replace($pattern,"highlight_code('\\1')",$text); }
return $text; }
function highlight_code($code){
$trans = get_html_translation_table(HTML_ENTITIES);
$code = stripslashes(strtr(strip_tags(str_replace('</P>',"\n",str_replace('<BR>',"\n",str_replace('\\',"\\\\",$code)))), array_flip($trans)));
ob_start();
highlight_string("<?\n".$code." ");
$code = ob_get_contents();
ob_end_clean();
$code = explode('<br />', $code);
$textwidth = "500";
$textsmallheight = "22";
$text = '<table class="standard" border="0" width="'.$textwidth.'" cellpadding="4" cellspacing="1" >';
$text .= '<tr><br><td class="quote">';
$text .= '<table class="quote" border="0" width="'.$textwidth.'" cellpadding="0" cellspacing="0" >';
$text .= '<tr><td class="quote"><b>Code:</b></td></tr>';
$text .= '<tr><td class="quote">';
$text .= '<table border="0" width="100%" cellpadding="0" cellspacing="0" >';
$text .= '<tr>';
for ($x=1; $x < sizeof($code); $x++)
if ($code[$x] != '') $x+0;
$textheight = $x*$textsmallheight;
$text .= '<td style="background-color: #FFFFFF;" width="100%" valign="top">';
$text .= '<div style="overflow: auto; width: '.$textwidth.'px; height: '.$textheight.'px">';
$text .= '<table class="quote" border="0" cellpadding="2" cellspacing="0" width="100%">';
for ($x=1; $x < sizeof($code); $x++)
if ($code[$x]!='')
$text .= '<tr><td style="background-color: #FFFFFF;" width="100%" height="'.$textsmallheight.'" nowrap>'.$code[$x].'</td></tr>';
$text .= '</table></div></td></tr></table></td></tr></table></td></tr></table>';
$pattern = "/COLOR\=\"\#(.*)\"/esiU";
while (preg_match($pattern,$text)) {
$text=preg_replace($pattern,"color2style('\\1')",$text); }
return $text; }
function highlight_phpcode($code){
$trans = get_html_translation_table(HTML_ENTITIES);
$code = stripslashes(strtr(strip_tags(str_replace('</P>',"\n",str_replace('<BR>',"\n",str_replace('\\',"\\\\",$code)))), array_flip($trans)));
ob_start();
highlight_string("<?\n".$code." ");
$code = ob_get_contents();
ob_end_clean();
$code = explode('<br />', $code);
$textwidth = "500";
$textsmallwidth = "40";
$textsmallheight = "22";
$text = '<table class="standard" border="0" width="'.$textwidth.'" cellpadding="4" cellspacing="1" >';
$text .= '<tr><br><td class="quote">';
$text .= '<table class="quote" border="0" width="'.$textwidth.'" cellpadding="0" cellspacing="0" >';
$text .= '<tr><td class="quote" width="'.$textsmallwidth.'" ></td><td class="quote"><b>Quell-Code:</b></td></tr>';
$text .= '<tr><td class="quote" colspan="2">';
$text .= '<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">';
$text .= '<tr><td valign="top" width="'.$textsmallwidth.'">';
$text .= '<table class="quote" border="0" cellpadding="2" cellspacing="0" width="'.$textsmallwidth.'" >';
for ($x=1; $x < sizeof($code); $x++)
if ($code[$x] != '')
$text .= '<tr><td class="quote" height="'.$textsmallheight.'" align="right" nowrap>'.($x+0).' </td></tr>';
$text .= '</table></td>';
$textheight = $x*$textsmallheight;
$textwidth = $textwidth-($textsmallwidth);
$text .= '<td style="background-color: #FFFFFF;" width="100%" valign="top">';
$text .= '<div style="overflow: auto; width: '.$textwidth.'px; height: '.$textheight.'px">';
$text .= '<table class="quote" border="0" cellpadding="2" cellspacing="0" width="100%">';
for ($x=1; $x < sizeof($code); $x++)
if ($code[$x]!='')
$text .= '<tr><td style="background-color: #FFFFFF;" width="100%" height="'.$textsmallheight.'" nowrap>'.$code[$x].'</td></tr>';
$text .= '</table></div></td></tr></table></td></tr></table></td></tr></table>';
$pattern = "/COLOR\=\"\#(.*)\"/esiU";
while (preg_match($pattern,$text)) {
$text=preg_replace($pattern,"color2style('\\1')",$text); }
return $text; }
function color2style($font_code) {
return "style=\"color: $font_code\""; } | |  | |
|
|
|
|
|
 |
Verfasst am 03.06.2008 - 00:47 Forenbeitrag von: burtb_5544 |
|
Linkübersicht -> Aufmachergrafiklink
Hallo !
Weiß jemand wo ich den Link der Aufmachergrafiken in der Linkübersicht ändern kann?
Der verweißt nämlich auf die Artikelübersichtsseite und ich will das er auf die angegebene Site verweist.
burtb |
|
|
|
|
|
|
|
 |
 |
Zur Zeit sind 520 Benutzer online: 2 Mitglieder und 518 Besucher - Rekord: 1814 Benutzer (Samstag, 14. Januar 2023, 07:00) Botty, Bottyline |
|
 |
Statistik: 6.222 Mitglieder - 4.945 Themen - 56.052 Beiträge (8 Beiträge pro Tag) Unser neuestes Mitglied heißt: HKS-CLAN |
|
|
|
 |
Heute haben folgende Mitglieder Geburtstag: Das Team von HTH-C.com wünscht einen schönen Geburtstag. molochos (54), Funny (49), Flanor (46), [BLO]@{Olaf} (59) |
|
|
|
|
|
|
|