This topic is locked

custom code is needed

3/3/2010 3:16:35 AM
PHPRunner General questions
U
uludag author

Hi,
There are three rows in my project that I am trying to combine them in one row. These are publication place, publisher, and publish year.
It has to appear like (New York: Routledge, 2010). So I need some custom codes, I think.
For publication place:

If not null, add : afterwards.


For publisher

If not null, add , afterwards.


Would you be kind enough to help me.
Thanks in advance.

U
uludag author 3/5/2010

Isn't there anybody who help me? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=48265&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

A
Aleix 3/5/2010



Isn't there anybody who help me? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=48268&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />


Hi Uludag;
Can you explain a bit more the problem, I am not sure the understand properly.
Bye

A
alang 3/5/2010



.. There are three rows in my project ..


Maybe you mean columns rather than rows ??
If so, then one way is to select one of the fields and select "Custom" field on the visual editor page (you can also create an alias in your SQL if you don't want to override one of the existing fields). You then add appropriate code like $value=$data["publication place"] ... etc

U
uludag author 3/6/2010



Maybe you mean columns rather than rows ??
If so, then one way is to select one of the fields and select "Custom" field on the visual editor page (you can also create an alias in your SQL if you don't want to override one of the existing fields). You then add appropriate code like $value=$data["publication place"] ... etc


Ok. Let me try to explain it much more clearly.
It's a library catalog arrangement. A record contains id, booktitle, author, publicationplace, publisher, publishdate, referencenumber, etc.
The view page of phprunner shows any record of this database:
Authorname: author

booktitle: title

Publicationplace: publicationplace

Publisher: publisher

Publishdate: publishdate

etc.
You are right when saying publicationplace, publisher and publishdate are columns. However, they seem rows in view page of phprunner.
Anyway, I want these there rows (in viewpage of phprunner) to be a one row. Something like:

Publicationplace: publisher, publishdate.
There are thousands of library records, and some of them do not have any publication place, and some do not have any publisher.
What I want to do is:

When the record contains a publicationplace, phprunner will add ":" at the and of publicationplace. when it does not contain a publicationplace, it will add nothing.

When I add ":" manually through visual editor, there appears ":" right after even those records that do not have any publicationplace.
The only way, it seems, to do this, is to add some codes to the custom page. But I am totally ignorant about the phpcodes, and urgently need help.
I hope I can express myself clearly enough.

S
swanside 3/6/2010



Ok. Let me try to explain it much more clearly.
It's a library catalog arrangement. A record contains id, booktitle, author, publicationplace, publisher, publishdate, referencenumber, etc.
The view page of phprunner shows any record of this database:
Authorname: author

booktitle: title

Publicationplace: publicationplace

Publisher: publisher

Publishdate: publishdate

etc.
You are right when saying publicationplace, publisher and publishdate are columns. However, they seem rows in view page of phprunner.
Anyway, I want these there rows (in viewpage of phprunner) to be a one row. Something like:

Publicationplace: publisher, publishdate.
There are thousands of library records, and some of them do not have any publication place, and some do not have any publisher.
What I want to do is:

When the record contains a publicationplace, phprunner will add ":" at the and of publicationplace. when it does not contain a publicationplace, it will add nothing.

When I add ":" manually through visual editor, there appears ":" right after even those records that do not have any publicationplace.
The only way, it seems, to do this, is to add some codes to the custom page. But I am totally ignorant about the phpcodes, and urgently need help.
I hope I can express myself clearly enough.


In phprunner, if you make sure the fields you want are placed under each other in the Totals page, so you would see it like;
Publicationplace

publisher

publishdate
then in the visual editor, can you not merge the three fields together using the merge feature and it will show the three fields together?

U
uludag author 3/7/2010



In phprunner, if you make sure the fields you want are placed under each other in the Totals page, so you would see it like;
Publicationplace

publisher

publishdate
then in the visual editor, can you not merge the three fields together using the merge feature and it will show the three fields together?


Merge function might be useful if all the record contain a publicationplace. When I merge these there fields, the results will be:

New York: Routledge, 2010

or

if the records does not contain any publicationplace

: Routledge, 2010.
The second output disturbs me. I do not want ":" to appear when the publicationplace is absent. The output in that case should only be:

Routledge, 2010.
And I can not do this with the merge function.

S
swanside 3/7/2010



Merge function might be useful if all the record contain a publicationplace. When I merge these there fields, the results will be:

New York: Routledge, 2010

or

if the records does not contain any publicationplace

: Routledge, 2010.
The second output disturbs me. I do not want ":" to appear when the publicationplace is absent. The output in that case should only be:

Routledge, 2010.
And I can not do this with the merge function.


Sorry, I am having a bad moment and dont quite understand where the ":" come from. Have a look here, is this something like what you are trying to display?, I have added three lines and filled the first one, and left stuff out on the second and third, click on the view and it shows it.
Paul

My link

U
uludag author 3/7/2010



Sorry, I am having a bad moment and dont quite understand where the ":" come from. Have a look here, is this something like what you are trying to display?, I have added three lines and filled the first one, and left stuff out on the second and third, click on the view and it shows it.
Paul

My link


Hi,

Thank you for your interest.

As my first message indicates, ":" is what I want from phprunner to add at the end of the publicationplace in viewpage automatically if it is not empty.

S
swanside 3/7/2010

Did you click on the My Link on the post above and see what it displays there?

U
uludag author 3/7/2010



Did you click on the My Link on the post above and see what it displays there?


I did it.
I uploaded a sample project with two records. One contains publicationplace, the other do not.
Please check it especially on viewpage:
http://demo.asprunner.net/kmuhtar74_gmail_com/library_deneme/library_list.php

S
swanside 3/7/2010

But It does not line up on the Blackwell Publishers 2004 as there is a space before Blackwell

U
uludag author 3/7/2010



But It does not line up on the Blackwell Publishers 2004 as there is a space before Blackwell


The space before Blackwell is only a minor problem.
My real problem is how we could add colon (":") automatically at the end of the publicationplace if it is not null. And how we could avoid that colon if the publicationplace is null.

S
swanside 3/7/2010



The space before Blackwell is only a minor problem.
My real problem is how we could add colon (<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=48306&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> automatically at the end of the publicationplace if it is not null. And how we could avoid that colon if the publicationplace is null.



have a look at this
http://demo.asprunner.net/pggrimes_hotmail_com/Publication/publicationplace_list.php
Got to cook dinner now, but let me know if its OK and I can send you the code.

Paul.

U
uludag author 3/7/2010

I really appreciate your effort, and thank you very much.
But this is not what I mean.
Your publicationdetails: Cambridge Polity Press 2006-03-01
It should be: Cambridge: Polity Press, 2006.