Home » Forum
NoNumber!

Joomla!® Websites & Extensions
development  -  support  -  consultancy

I try to respond within 48 hours (excluding weekends).
If I haven't responded by then, feel free to post a reminder or bug me via email.

My last reply was: 3 Hours, 58 Minutes ago.

Welcome, Guest
Please Login or Register.    Lost Password?

PHP codes doesn't translate JReview's dynamic URL
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: PHP codes doesn't translate JReview's dynamic URL
#7482
PHP codes doesn't translate JReview's dynamic URL 1 Year, 11 Months ago  
How is it going everyone?

I did a search on the forum and there is no answer to my findings.

I think it will be better if I am explaining what I am doing, just so we get a clearer sense of what I am trying to achieve.

So I am using Sourcerer with article page (com_content), which also utilizes by JReviews extension. JReviews take advantage of Joomla's com_content so well, all com_content's content plugins should work with JReview effortlessly. JReview is essentially a listing/directory extensions, so every listing is actually displayed in article page.

For every listing page, i am making a badge image that display its source codes, with a href and img src, and by the anchor will have dynamic link for each listing, which processed by JReviews.

To illustrate, look below:


Click for full size - Uploaded with plasq's Skitch

or more familiar badging solution would be Blogger's or ATAAW-like badges:


Click for full size - Uploaded with plasq's Skitch

So I got everything worked out okay, except for dynamic URL. So again, since JReview is using article page, so I could use syntax directly in JReview detail.thtml files. So here is my code used to achieve below screenshots:

{source 0} [[div style="margin: 0 auto;font-size:10px;font-family:helvetica neue,helvetica,arial,serif;"]][[textarea rows="10" cols="20"]]<a href="[[?php echo '$Routes->content('',$listing,'','',false)'; ?]]" target="_blank"><img src="/images/stories/heart_shadow.png" border="0" alt="curve" style="width: 150px; height: 90px;" /></a>[[/textarea]][[/div]]{/source}



Click for full size - Uploaded with plasq's Skitch

If you look at the above screenshot, we could see that all parts inside Sourcerer worked out, except for PHP. I have break down each function just so you see more clearly.

{Source 0} = it display the code just like the badges I am imitating.
[[div style]] = font was resized etc.
[[textarea]] = the box width x height.

[?php ?] = doesn't translate the dynamic URL. Instead, it gives Sourcerer Comment Errors.

the PHP code below, if used anywhere outside Sourcerer syntax, will generate the dynamic URL I meant:

<?php echo $Routes->content('',$listing,'','',false);?>



Click for full size - Uploaded with plasq's Skitch

So like I illustrated above, all codes work within Sourcerer syntax, except for that PHP (it worked if I write echo 'this', but obviously the reason why we are using Sourcerer is to get those function to "read" & "publish" PHP).

To make complete sense of what I am trying to achieve, so on each of every listing (with its own url; like /listing-1.html, /listing-2.html etc.), that have badge that display its source, and for every each anchor that it shows, supposed to be unique and displayed accordingly to the URL of the listing.

Sorry for the long post and if I am not making much sense (pardon my noobness, I have no proper knowledge of codes and programs. Most of my experience are solely experimenting and trial & error). Thank you very much for your time and concern for this. Please advise.

ps: I wish I could be more clearer and you guys get what I am saying. Let me know if I need to explain further. Many thanks again.
derred
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#7484
Re:PHP codes doesn't translate JReview's dynamic URL 1 Year, 11 Months ago  
(contd) regarding why have dynamic URL for badge solution

The idea was, to have each listing page (with its own Review section --duhh its JReviews--) with the same image of badge, but unique link TO it).

So I have a directory site that collects blogs for instance. And you are one of my users.

So as a lister, You would want to copy this badge source, and paste it on your Blogger's page, so it display that badge, AND link it directly to your Listing & Review page. You would want YOUR user, to leave great review about your blog, on that listing page.

So as for different user with different listing page (hence, different URL). He/She will get the badge source for their own listings, link it to HIS/HER blogs, so their users can leave review on their own listings respectively.

I hope that explains why the dynamic URL, instead of typical static URL for badging solution. Another important thing is that this dynamic URL processed by JReview DOES work outside syntax, which means I am missing some pieces on making it work on Sourcerer.

Thank you again for your time and concern. Please advise.
derred
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#7486
Re:PHP codes doesn't translate JReview's dynamic URL 1 Year, 11 Months ago  
Man, what a long story...
In your code I see this:
[[?php echo '$Routes->content('',$listing,'','',false)'; ?]]


Why the quotes?
Should be:
[[?php echo $Routes->content('',$listing,'','',false); ?]]
Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#7488
Re:PHP codes doesn't translate JReview's dynamic URL 1 Year, 11 Months ago  
Peter van Westen wrote:
Man, what a long story...
In your code I see this:
[[?php echo '$Routes->content('',$listing,'','',false)'; ?]]


Why the quotes?
Should be:
[[?php echo $Routes->content('',$listing,'','',false); ?]]


Sorry.. I was being detail about it

Without the quotes, the whole page will turned white blank.
derred
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#7489
Re:PHP codes doesn't translate JReview's dynamic URL 1 Year, 11 Months ago  
Can you give me admin access?
Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#7490
Re:PHP codes doesn't translate JReview's dynamic URL 1 Year, 11 Months ago  
So nice of you

Too bad I am working on localhost

Anyway, thank you very much! I guess I have to find a way by myself for the time being. I am getting a live dev site up soon in 2 weeks time. Not until then I could share what caused the problem, and hopefully, fix it.

Many thanks again!
derred
Posts: 4
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: Peter van Westen
hosting joomla
Open Source Training | Online Joomla! Training and Support
MaxCDN | Content Delivery Network | Accelerate your site to the max