Phine Solutions web work notes

SMF to IPB conversion

Filed under: programming in general by 1.618 — January 18, 2010 10:04 am

I just converted a SMF board (1.1.7) to IPB and there is some issues that I ran into that is worth to be shared.

If you have installed IPB you probably understand how the converter works. It’s a separate “app” that needs to be installed and the there is document to address how to use it. Basically on the admin converter page you are presented with several steps that need to be preformed, each one of them is specifically for converting some kind of data, such as “members”, “forums” etc. The problem I had was in the forum conversion step.

My original SMF board had a pretty simple forum structure: one main category, and a bunch of forums under it. It’s a pretty good mapping to IPB. However the converter refused to convert the sub forums, and only took the single top category in. Naturally not much information about this behavior can be found online because of the small user community of IPB, so I opened the converter code and took a peek.

Here is the problem I found:

Starting on line 608, in admin/applications_addon/ips/convert/modules_admin/board/smf_legacy.php file, is the code which loops through the existing forums and puts them into the new IPB database. The problem, as you can see in the code below, is that a “$loop” variable is built using the database result (fetched in the first while loop) but is never used later on. A few lines below, a second “fetch” is done in the second while loop to get the records. And based on my test, the second while loop never retrieves anything back.

$i = 1;
while ( $row = ipsRegistry::DB(‘hb’)->fetch() )
{
$records[] = $row;
}
$loop = $records;
//—————————
// Loop
//—————————
while ( $row = ipsRegistry::DB(‘hb’)->fetch($this->lib->queryRes) )

I’m not sure the fact that the second while loop returning empty is the correct behavior of database API, or simply just a bug. But regardless of the reason, the first while loop to build the variable seems to be redundant and mostly likely was for the debugging purpose in the first place.

Once the cause was identified the issue was easy to fix. Just replace the second while loop with this:

foreach ($loop as $row)

Which basically use the previously built “$loop” variable for the cycle. And the SMP forums should be happily converted by IPB.

Keep in mind a lot can go wrong when converting boards between different software, especially from the one that has a lot of customizations. Hopefully this post provides some insight on troubleshooting the script.

The above issue is for IP.Board 3.0.5 only.

1 Comment

  1. [url=http://bit.ly/aJNvh8][img]http://s52.radikal.ru/i136/1005/55/730237f9b3b7.gif[/img][/url]
    ????? ???? ??? ??????? ???????? ?????? – ????????, ??? ???? ????????? ?????? ??????? ????????? ????????????? ???????????? ? ????? ??????? ???????????? ??????? ?????? ??????????? ??????????. ?? ??????????????? ???? ??? ??????? ?? ????????????? ??? ??????? ? ????? ??????, ? ???????????? ??????? ???????? ?????????. ?????? ???? ??? ??? ??? ??????? ?????? ??? ????????? ???????? ????? ??????? ? ??????????????? ??????? ?????? ?? ?????? ? ???? ??? ???????? “??????????” ? ???? ?????? ? ???? ?????????? ????????? ???????, ???????? ?? ?????? ???????????????? ??????????? ????????, ?? ? ??????? ??? ???????????. ?????????? ????? 4 ????? ??? ????? ??????? ????????? ???? ?? ????? ???????? ? ????????. ?????????? ????????? ? ??????? ???????? ???????? ?? ??, ??? ???????? ???????? ? ?????????? ?????????? ????? ??????? ? ?????????? ????? ?????? ??????? ????? ???????? ? ??????-??????????? ?????????????? ? ?????? ? ?????? ???????-???????? ???????. ? ???? ? ???????????? ??????? 52 ??????????????, ??????????? ?????? ???? ??? ??????? ? 3 ??? ??? ? ?????? ??????? ?????????. “?? ????? ????????? ? ???, ??? ????????? ? ?????????????? ??????? ? ????????? ????????????? ????? ?????? ?????????? ?????? flash ???? ??? ??????? ????? ? ????????? ??????? JPEG, ????? ?? ?????? ??????????, ?????? ?? ????????????? ??????? ?? ???????????, – ?????? ???????????? Forgent Networks ?????? ??????? (Richard Snyder). ???????????? ???????????????? ?????????? ???? ??? ??????? ???????? ??? ? ????????????? ???????? ???????. “????????????? ????? http://www.winx4 com ???????? ?????? ??????????? ??????? ? ????????”, – ??????? ??????. ??? ???? ??? ??????? ??????? ? ?????? ?????? 60 ????? ?????????? ?????, ????????????? ???????? ? ????? ?????????? ?????? ??????? ?????????? ????????? ????????? ??????????, ???????? ??? ??????? ????????????.
    ?????? ? 1882 ???? ????? ???????????? ???????? ???? ??????? ??????????????? ??????????? ????? ? ????????? ??? ?????? ????????? ??????? ?? ?????. ? ??????? ???? ???????? ????? ????? ?? ???????????? ????? “??????” ? ?????????, ???????? ?????????? ??? ????? 12 ?????. ?????????? ?????? ????????????? ??????? ????????? ???? ?? ????. ??????? ????? ???????? ??????? – ?????? ? ??????? ???????????? ????????? ????? ?????????? ????????? ?? ????? ???????????????? ???????. ? ????? ????????, ??? ??? ??? ?????? ????????? ????? ??????????? ??? ?? ????????? ????????? ????. ?? ????? ??????????? ???????? ????? – 54 ???????????. ? ??? ????????? ????????? ???????? ??? ????????? ????? ???? ???????? ? ??????? ?? ?????? ??????? ?????? ???? ??? ??????? ? ??????? ????? ????-????????, ??????????? ????????????? ??????????? ????????????- ????????? ???????? ??? ?????? ??????????????, ?????? ?? ?????????? ???????????????? ??????????? “?????? ??? ? ?? ?????”. ??????????????? ???? ?????? ???????? ???????? ?? ???? ??? ??????? ?? ?????? ?????? ???? ???? “????????????? ??????????????” ?? ???????-???????? ???????. ????? ????????? ????????? ????? 4 ????? ????????? ?? ??????? ? ?????? ???? ????????.
    [url=http://wvu-l.narod.ru/obschestvo/igry-dlya-devochek-shkola-tancev.html]???? ??? ??????? ????? ??????[/url]
    [url=http://w-ies.narod.ru/kommentarii/winx-layla-mermaid.html]winx layla mermaid[/url]
    [url=http://xct2-o.narod.ru/obrazovanie/igry-dlya-devochek-onlayn-kvesty-na-russkom-yazyke-bez-skachivaniya.html]???? ??? ??????? ?????? ?????? ?? ??????? ????? ??? ??????????[/url]
    [url=http://ygepep.narod.ru/proisshestviya/igry-dlya-devochek-v-gotovku-edy-igrat-onlayn-besplatno.html]???? ??? ??????? ? ??????? ??? ?????? ?????? ?????????[/url]
    [url=http://uzsa.narod.ru/novosti/vinks-klub-shkola-volshebnic-igry-dlya-devichi-igry.html]????? ???? ????? ????????? ???? ??? ?????? ????[/url]
    [url=http://zzumojlj.narod.ru/igry/poshlye-igry-dlya-devochek.html]?????? ???? ??? ???????[/url]
    [url=http://zke-a.narod.ru/proisshestviya/kukly-vinks-i-petomcy.html]????? ????? ? ???????[/url]
    [url=http://xlemuboe.narod.ru/finansy/cmotret-multik-vinks.html]c??????? ??????? ?????[/url]
    [url=http://zpoec.narod.ru/biznes/msvcpdll-winx-club.html]msvcp.dll winx club[/url]
    [url=http://xsend-f.narod.ru/filmy/vinks-igry-leyla-v-igrah.html]????? ???? ????? ? ?????[/url]
    [url=http://vtuyn.narod.ru/ukraina/vinks-na-kotke.html]????? ?? ?????[/url]
    [url=http://w-fly.narod.ru/biznes/vinks-kartinki-4-sezon-i-5-sezon.html]????? ???????? 4 ????? ? 5 ?????[/url]
    [url=http://v-ouk.narod.ru/pressa/igry-dlya-devochek-besplatno-stepanida.html]???? ??? ??????? ????????? ?????????[/url]
    [url=http://zgoqefayxn.narod.ru/avtomobili/igry-dlya-devochek-sh2o.html]???? ??? ??????? ?h2o[/url]
    [url=http://ya-otoio.narod.ru/ekonomika/igry-dlya-devochekigry-na-prigotovlenie-edy.html]???? ??? ???????.???? ?? ????????????? ???[/url]
    [url=http://ya-epesi.narod.ru/anonsy/igry-dlya-devochek-sovmestimost-po-znakam-zodiaka.html]???? ??? ??????? ????????????? ?? ?????? ???????[/url]
    [url=http://vjago5.narod.ru/o-proekte/odevalki-muza-vinks.html]???????? ???? ?????[/url]
    [url=http://uxinupaciqb.narod.ru/ukraina/igry-dlya-devochek-ot-3let.html]???? ??? ??????? ?? 3???[/url]
    [url=http://yroc0.narod.ru/suzhety/igry-dlya-devochek-dzhymikul.html]???? ??? ??????? ????????[/url]
    . ????? ???? ??? ??????? ???????? ??????! ? ?? ?? ?????, ???? ?????? ????? ????????? ? ?????? “????????” (Unfaithful), ???????? ????? ??????? ?????? ???? ??? ???????? Fox. ?? ?????? ???, ? ?????? ?????????? ????? ??????????? ????? 9 ????? ?????????? ???? – ??? ?????. ?????????? ????? ???????? ?????? ???????, ????? 2010 ???? ?????????? ?? ????????, ? ????? ???????????? ?????????? ???-?????????????? ?? ??????????????? ? ????????????? ???????. ?????? ???? ?????? ??? ??????? ??????? ???????? ?ndex ?????? ??????????? ? 12,52 ??? ???????? ???. ??? ????????????, ???????????? ????? ??????? ???? ??? ??????? ??????? ????????? ??????????? ? ? ??? ?????? ???????????? – ???????? 42-?????? ??????? ? ??????????, ???? ??????? 21 ???????? 2552 ????. ? 1445 ????, ????????? ??? “???????”, ???? ??? ??????? 145-???????? ????? 4 ????? ??????? ??? ????????, ?? ??????? ?????????? ??????????? ? ????????? ???? ???. ???????? ????????? ????? ???? ? ?????? ?????? ?? ????? ?? ???????. ????? ?? ??? ??? ?????????? ?? ?????????? ???? ???? ????? ???? 1 ????? ???????? ?????? ???????????? ?????? ???? ?????????? 122 ?????????? ???????. ?????? ??????? ??? ? “????????????? ????? ????????? ????? ??????”. ?????? ????? ????? ?? ????? ??? ???? ???? ??? ??????? ?????? 14 ??????? ?????? ? 2555 ????. ??????? ???? ?? ???? ???????? ????? ????????? 4 ????? ??????? ?? ??????? ????? ?????? ???? ????? ????? ?????? ?? ????????? ?????-???. ? ?????? ? ????? ????????????? ???????? ?? 44-? ???? ????? ?????????? ???? ????? ? ????? ???????? ???????????? ?????? ????????.
    ?????? ??????? ???????????? ????? ? ?????? ???????????? ? ?????????? ??????? ???????? ????????? ?????????? Scorpio II. ???????? ???????? ?????????? ??????? ? 22-? ?????, ????? ????? ???????? ???? ????????? ??-?? ??????????? ???????????????. ?? ??????????????? ??????, ?????, ?????????? ??????????????, ???????? ???????? ?????????? ????????. ??? ? ??????????? ????????? ?????????????? ?????????? ??? ??????? ????????? ????????????. ? ??????? ? ??????? ?????? ??? ??????? ????????? ????????????? ??????????? ?? ????????? ???????, ???????? Reuters. ???????? ?????? ??? ???????? ?? ??????, ??? ?????????? ???? ??? ????????? ??????? ????????? ????? ?????????????? ???????????, ??? ???????????? ???, ?????? ??????????. ?? ??????? 12 ???????, ? 5:14, ??-?? ??? ????? ???? ?????? ??? ??????? ????? ?????? ??? ???????? ?????? ?????????? ?????????? ???! ???????????? ?????????? ??????????????? ???????????? ???? ??? ??????? 3-4 ??? ??????????? ?????????? ?????????, ? ??????? ???????????? ????? ?????????? ???????????? ?????, ?????? ????? ??????????, ???????? Reuters. ?? ???? ??? “???????” ???? ??? ??????? ?? ???? ?????? ??????? ?????? ??????????? ???????????? ??? ??????? ?????.
    ????? ???? ??? ??????? ???????? ??????!
    [url=http://uz22010.narod.ru/avtomobili/tekst-pesni-vinks-4-sezona.html]????? ????? ????? 4 ??????[/url]
    [url=http://yridelo.narod.ru/politika/flesh-onlayn-biznes-igry-dlya-devochek.html]???? ?????? ?????? ???? ??? ???????[/url]
    [url=http://zpeec.narod.ru/obrazovanie/igry-onlayn-dlya-devochek-ot8-do-88-let-besplatno.html]???? ?????? ??? ??????? ??8 ?? 88 ??? ?????????[/url]
    [url=http://xcopibio-o.narod.ru/politika/noveyshie-igry-simulyatory-dlya-devochek-igrat-onlayn.html]???????? ???? ?????????? ??? ??????? ?????? ??????[/url]
    [url=http://y-uoe.narod.ru/pressa/pesni-vinks-onlayn.html]????? ????? ??????[/url]
    [url=http://x-enno.narod.ru/rossiya/poigrat-v-besplatnye-igry-dlya-devochek-pocelui.html]???????? ? ?????????? ???? ??? ??????? ???????[/url]
    [url=http://xsend-f.narod.ru/umor/ofecialnyy-sayt-kluba-vinks.html]??????????? ???? ????? ?????[/url]
    [url=http://zcovefaih.narod.ru/o-proekte/deckie-igry-dlya-devochek.html]?????? ???? ??? ???????[/url]
    [url=http://xcopibio-o.narod.ru/novosti/shirokoformatnye-winx-oboi.html]??????????????? winx ????[/url]
    [url=http://ytiwdo.narod.ru/avtomobili/vinks-igry-i-igry-pro-zhivotnyh.html]????? ???? ? ???? ??? ????????[/url]
    [url=http://xride4.narod.ru/zdorove/skachat-winx-na-komputer.html]??????? winx ?? ?????????[/url]
    [url=http://zke-a.narod.ru/novosti/raskraski-vinks-rusalochki.html]????????? ????? ?????????[/url]
    [url=http://v-ouk.narod.ru/finansy/igry-vinksigry-stilnye-devchnki.html]???? ????????? ???????? ????????[/url]
    [url=http://ya-otoio.narod.ru/obschestvo/igry-dlya-devochek-novye-bratc.html]???? ??? ??????? ????? ?????[/url]
    [url=http://xyp-p.narod.ru/politika/winx-club-multiki-onlayn.html]winx club ???????? ??????[/url]
    [url=http://xoo-k.narod.ru/politika/vinks-s-pitomcami.html]????? ? ?????????[/url]
    [url=http://y-xyl9.narod.ru/filmy/igry-onlayn-dlya-devochek-princesy-simulyatory.html]???? ?????? ??? ??????? ???????? ??????????[/url]
    [url=http://xlemuboe.narod.ru/biznes/opisanie-seriy-winx-club-4-sezona.html]???????? ????? winx club 4 ??????[/url]
    [url=http://ytiwdo.narod.ru/znakomstva/besplatno-skachivaem-igry-dlya-devochek-pazly.html]????????? ????????? ???? ??? ??????? ?????[/url]
    [url=http://wyunicamu5.narod.ru/glavnye-novosti/besplatnye-igry-dlya-devochek-pricheski-manikur-i-pedikur.html]?????????? ???? ??? ??????? ???????? ??????? ? ???????[/url]
    [url=http://w-fly.narod.ru/proisshestviya/igry-dlya-devochek-barbi-bratc-i-vinks.html]???? ??? ??????? ????? ????? ? ?????[/url]
    [url=http://wvu-l.narod.ru/razvlecheniya/igry-dlya-devochek-vinks-besplatno-100-igr-bez-odevalok.html]???? ??? ??????? ????? ????????? 100 ??? ??? ????????[/url]
    [url=http://xsebide.narod.ru/kontakty/igry-dlya-devochek-vrach.html]???? ??? ??????? ????[/url]
    [url=http://yfutt.narod.ru/v-mire/igry-dlya-devochek-onlayn-bratc-i-barbi-besplatno-odevalki.html]???? ??? ??????? ?????? ????? ? ????? ????????? ????????[/url]
    [url=http://yfutt.narod.ru/biznes/winx-club-5sezon-smotret.html]winx club 5????? ????????[/url]
    [url=http://ya-otoio.narod.ru/avto/igrat-v-modnye-igry-dlya-devochek-odevalki.html]?????? ? ?????? ???? ??? ??????? ????????[/url]
    [url=http://uyupehz.narod.ru/turizm/onlayn-igry-devochek-paceluy.html]?????? ???? ??????? ???????[/url]
    [url=http://vxo0.narod.ru/muzyka/besplatye-igry-dlya-devochek-na-odevanie-i-na-makiyazh.html]????????? ???? ??? ??????? ?? ???????? ? ?? ??????[/url]
    [url=http://znofit4.narod.ru/obschestvo/pasporta-vinks-chetvrtyy-sezon.html]???????? ????? ????????? ?????[/url]
    [url=http://yok-t.narod.ru/kommentarii/magazin-ot-winx-love-pet-igra.html]??????? ?? winx love pet ????[/url]
    [url=http://ygepep.narod.ru/medicina/multflmi-winx-club.html]??????????? winx club[/url]
    [url=http://ya-iqs7.narod.ru/biznes/roksy-winx.html]roksy winx[/url]
    [url=http://uvemevumap1.narod.ru/biznes/igry-onlayn-dlya-devochek-varit.html]???? ?????? ??? ??????? ??????[/url]
    [url=http://yok-t.narod.ru/kommentarii/igry-dlya-devochek-pro-schenyat.html]???? ??? ??????? ??? ?????[/url]
    [url=http://v-ouk.narod.ru/finansy/igry-raskrasit-vinks-v-inchantiks.html]???? ?????????? ????? ? ?????????[/url]
    [url=http://ybidelo.narod.ru/kommentarii/igry-odevalki-dlya-devochek-s-ocenkoy.html]???? ???????? ??? ??????? ? ???????[/url]
    [url=http://uyon0-c.narod.ru/biznes/mini-igry-dlya-devochek-skachat-besplatno-polnye-versii-bez-registracii.html]???? ???? ??? ??????? ??????? ????????? ?????? ?????? ??? ???????????[/url]
    [url=http://y-xyl9.narod.ru/tema-dnya/igry-vinks-enchantiks-besplatnoi-bratc.html]???? ????? ????????? ?????????? ?????[/url]
    [url=http://vtuyn.narod.ru/biznes/igry-dlya-devochek-super-moda.html]???? ??? ??????? ????? ????[/url]
    [url=http://zke-a.narod.ru/suzhety/igry-dlya-devochek-delaem-bolshie-prichski.html]???? ??? ??????? ?????? ??????? ????????[/url]
    [url=http://znofit4.narod.ru/obschestvo/ramki-vinks-dlya-fotoshopa-besplatno.html]????? ????? ??? ???????? ?????????[/url]
    [url=http://zzodayro.narod.ru/nedvizhimost/igry-dlya-devochek-gorod-mechty-dzheyn.html]???? ??? ??????? ????? ????? ?????[/url]
    [url=http://vva-h.narod.ru/kultura/igry-dlya-devochek-na-pocelui-v-ofise.html]???? ??? ??????? ?? ??????? ? ?????[/url]
    [url=http://ykom7.narod.ru/v-mire/igry-dlya-devochek-onlayn-s-prohozhdeniem.html]???? ??? ??????? ?????? ? ????????????[/url]
    [url=http://ymz9.narod.ru/filmy/vinks-video-4-sezon-na-ruskom.html]????? ????? 4 ????? ?? ??????[/url]
    [url=http://zzodayro.narod.ru/biznes/oden-vseh-fey-vinks.html]????? ???? ??? ?????[/url]
    [url=http://xct2-o.narod.ru/medicina/igry-dlya-devochek-odevalki-tancev.html]???? ??? ??????? ???????? ??????[/url]
    [url=http://uvagau.narod.ru/medicina/igry-dlya-devochek-bratc-besplatno-onlayn-igat.html]???? ??? ??????? ????? ????????? ?????? ?????[/url]
    [url=http://x-enno.narod.ru/nedvizhimost/besplatnye-igry-dlya-devochek-onlayn-makiyazh-simulyatr.html]?????????? ???? ??? ??????? ?????? ?????? ????????[/url]
    [url=http://w-ies.narod.ru/avto/golosovanie-kto-ty-iz-vinks.html]??????????? ??? ?? ?? ?????[/url]
    [url=http://vtai2010.narod.ru/obschestvo/4-sezon-vinks-smotret-v-onlaen.html]4 ????? ????? ???????? ? ??????[/url]
    [url=http://uyupehz.narod.ru/proisshestviya/oonlayn-besplatno-igry-dlya-devochek.html]??????? ????????? ???? ??? ???????[/url]
    [url=http://uwec.narod.ru/glavnye-novosti/vinks-na-ldu-igra.html]????? ?? ???? ????[/url]
    [url=http://zqivode1.narod.ru/o-proekte/winx-rukzaki.html]winx ???????[/url]
    [url=http://uyupehz.narod.ru/obschestvo/vinks-4-smotret-onlain.html]????? 4 ???????? ??????[/url]
    [url=http://uzsa.narod.ru/reklama/igra-vinks-believix-in-you-skachat-besplatno.html]???? ????? believix in you ??????? ?????????[/url]
    [url=http://yridelo.narod.ru/proisshestviya/igry-dlya-devochek-uborka-na-rabote.html]???? ??? ??????? ?????? ?? ??????[/url]
    [url=http://wpicamu5.narod.ru/finansy/dochki-vinks-foto.html]????? ????? ????[/url]
    [url=http://w-vnc.narod.ru/zdorove/prikolnye-igry-besplatno-dlya-devochek.html]?????????? ???? ????????? ??? ???????[/url]
    [url=http://uzsa.narod.ru/novosti/kukly-vinks-ukrainskie.html]????? ????? ??????????[/url]
    [url=http://wloi-d.narod.ru/kino/igry-na-poceluy-dlya-devochek.html]???? ?? ??????? ??? ???????[/url]
    [url=http://zcovefaih.narod.ru/pressa/interesnye-i-smeshnye-igry-dlya-devochek-onlayn-igrat-besplatno.html]?????????? ? ??????? ???? ??? ??????? ?????? ?????? ?????????[/url]
    [url=http://vxo0.narod.ru/novosti/igry-onlain-dlya-devochek-besplatno-odevalki-ili-salon-krasoty.html]???? ?????? ??? ??????? ????????? ???????? ??? ????? ???????[/url]
    [url=http://yjw-d.narod.ru/turizm/igry-dlya-devochek-ranetki-raskraski.html]???? ??? ??????? ??????? ?????????[/url]
    [url=http://znofit4.narod.ru/kommentarii/vinks-klub-skachat-igry.html]????? ???? ??????? ????[/url]
    [url=http://znojexonk-d.narod.ru/avto/lera-iz-kluba-vinks.html]???? ?? ????? ?????[/url]
    [url=http://yjw-d.narod.ru/kino/smotret-onlay-vinks-4sezon.html]???????? ????? ????? 4?????[/url]
    [url=http://ydafezoda9.narod.ru/politika/igry-dlya-devochek-na-odevanie-s-ubki.html]???? ??? ??????? ?? ???????? ? ????[/url]
    [url=http://z-lynz.narod.ru/igry/igry-dlya-devochek-fabrika-zvezd-1.html]???? ??? ??????? ??????? ????? 1[/url]
    [url=http://w-ies.narod.ru/muzyka/vinks-besplatno-vs.html]????? ????????? ???[/url]
    [url=http://znojexonk-d.narod.ru/avto/igry-dlya-devochek-ot-6-let-do-7-let.html]???? ??? ??????? ?? 6 ??? ?? 7 ???[/url]
    [url=http://whrq.narod.ru/glavnye-novosti/lubimye-igry-devochek-brac.html]??????? ???? ??????? ????[/url]

    Comment by Eronryunell — May 4, 2010 @ 9:56 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

©phinesolutions.com