UBB-parser

Gestart doorOne2xs10 reacties41 weergaven

11 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Hey,

Ik ben bezig met een ubb-parser en dit topic gebruik ik om vragen te stellen

vraag 1:
Waarom werkt dit niet?:

[COLOR= #0000BB]<? $ubbCount[/COLOR][COLOR= #007700]++;[/COLOR] ?>


De code staat in een functie en onderaan de pagina echo ik dus de ubbCount

Opgelost

Vraag 2:
Ik heb de volgende code:

[COLOR= #0000BB]<? $imgs[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]:D[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]biggrin.gif[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]:)[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]happy.gif[/COLOR][COLOR= #007700]);[/COLOR] ?>


Moet ik een forach gebruiken om ze te parsen?
zoja hoe?

Opgelost:
http://www.one2xs.com/forum/topic?p=last&id=13462#186500

Vraag 3:
Ik heb de volgende code:

[COLOR= #0000BB]<?php[/COLOR] [COLOR= #FF8000]/* array */[/COLOR]
[COLOR= #0000BB]$codes[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000][b](.*)[/b][/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]<strong>\1</strong>[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]/* codes parsen */[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$codes[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$ubb[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$html[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ubb[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$html[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]);
    }[/COLOR]
?>


nu krijg ik deze error:
Warning: preg_replace() [function.preg-replace]: Unknown modifier ( in /home/niels/***/public_html/***/includes/ubb_parser.inc.php on line 20
(lijn 20 is de preg_replace)

Opgelost

Vraag 4:
Hoe gebruik ik geshi?
Ik wil alles wat tussen de
 
tags staar parsen maar hoe?
http://qbnz.com/highlighter/index.php

Dit waren mijn vragen tot nu toe
Als ik meer vragen heb wordt deze post aangepast
Als je reageert graag erbij zetten welke vraag

Alvast bedankt, Niels
0
Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waar is die variable goed voor?
0
Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zocht op google en toen zijden zij google zelf al zonder spatatie

[COLOR= #0000BB]<? $ubb[/COLOR] [URL="http://www.php.net/Count"]Count[/URL][COLOR= #007700]++;[/COLOR] ?>


Kan dat het dikke onzin isxD
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat is het ook.
Heb je er een global van gemaakt?
Post anders even de hele code zo kunnen we niet veel doen.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
@alemaalte TNX
ik heb bovenin nu:
global $ubbCount;
en het werktsmile
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Vraag 2:

[COLOR= #0000BB]<?php
$imgs[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]:D[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]biggrin.gif[/COLOR][COLOR= #007700],[/COLOR]
              [COLOR= #DD0000]:)[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]happy.gif[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$imgs[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$img[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$afb[/COLOR][COLOR= #007700])
{[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$afb[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" title="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$img[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" alt="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$img[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];

}[/COLOR]
?>


Zoiets denk ik, het kan zijn $afb en $img omgedraaid moeten worden in de imgtag.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
TNXsmile
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Graag gedaan. biggrin
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Vraag 3 (waar erik via msn niet uitkwam) toegevoegd
0
Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR] [COLOR= #FF8000]/* array */[/COLOR]
[COLOR= #0000BB]$codes[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"[b](.*)[/b]"[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]"<strong>1</strong>"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]/* codes parsen */[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$codes[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$ubb[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$html[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ubb[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$html[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]);
    }[/COLOR]
?>


werkt dat soms?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
nee
het komt denk door de (.*)
of omdat ik global $codes doe?

EDIT:
/(.+?)/i
werktemo(van internet)
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren