Hi all,
A new version is available to download from the first post of this thread.
changes from previous version:
- pagination support
- 2 new parameters: perPage - number of items per page
numLinks - number of visible links from each side of the current page number
- the parameter ’limit’ is now obsolete
any feedback is welcome!
Amir
hi amirm, this snippet really rocks, but i have a little problem, i dont know if you could fix this:
i need to use the same place holder twice for make a links like the following:
<a href="#" onclick="new Link('borrar','[+id+]');" title="borrar">delete</a>
<a href="#" onclick="new Link('editar','[+id+]');" title="editar">edit</a>
but the snippet only returns one [+id+], the other is left in blank... is there a easy way to fix this?
thanks in advance
visit us at www.dospuntocero.cl
dospuntocero, I have uploaded a version which fixes it.
Please check it out and let me know whether it solved your problem.
Amir
now works perfect !!!
thanks for that!
by the way...
in the snippet file you have a typo
<?php
/******************************************
* Snippet: loopDbChunk ...
* parameters:
*
* tableNane - the relevant table name (required) <- must say tableName

*
thanks for all!!
visit us at www.dospuntocero.cl
if i make a query like the one in the next line, the class (or modx) cuts it when the first equal sign appears, showing the following error:
query:
Select Cer_Nombre,NombreNave,Cem_FechaEmision,Cem_UsuarioEmisor from Certificados,CertificadosEmitidos,Naves where Certificados.Id=CertificadosEmitidos.Certificados_Id and CertificadosEmitidos.Naves_Id=Naves.Id and Naves.Propietarios_Id=1
error:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’"Select Cer_Nombre,NombreNave,Cem_FechaEmision,Cem_UsuarioEmisor from Certificad’ at line 1 »
SQL: "Select Cer_Nombre,NombreNave,Cem_FechaEmision,Cem_UsuarioEmisor from Certificados,CertificadosEmitidos,Naves where Certificados.Id
note that te sql passed to loopdbchunk is trimmed in the first = , lossing complete coherence and creating an error
if i put the sql code in the phpMyAdmin, it returns the requested data without problems
visit us at www.dospuntocero.cl
cw,
for editing: create a link to an eform page where you edit the page.
for deleting: create a snippet that looks for "delete_id" or something. Then generate the form in line with loopdb. (of course these functions should be protected with superadmin or user permissions)
I did this with one site and it’s worked pretty well.
ProWebscape: Thanks for the tips, it is along the lines of what I was considering.
Is there any way to add PHx support like in Ditto? That would be cool.
Installed LoopDbChunk and it works great: But I have a question, the data I’m displaying is about 139 pages long. How would I get it to just display a range of records, such as list names A through D? I’ve been reading up on mysql but can’t find anything on querying a range of names.
Just because I don't know what I'm doing, it has never stopped my from breaking something.