Can't change contact url show ad page | Support Questions | Support Forum

A A A

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Can't change contact url show ad page
February 21, 2019
8:34 am
pizzalover
New Member
Members
Forum Posts: 2
Member Since:
February 21, 2019
sp_UserOfflineSmall Offline

Hello, first of all thank you for creating such an amazing product that saves a lot of time to anyone who wants to create a quick classifieds site.

I am currently testing the AWPCP plugin (last version) and wanted to try to integrate it with a membership plugin, so far so good, until i wanted to change the contact url that is shown in the single ad page.

This is the original code i tried to change id ad/listing settings:

<a href="$codecontact">Contact $adcontact_name</a>

If i change the href value to $adcontact_name in the ad/listing settings in the dashboard it appears to prepend the ad listing's url to it, also tried to change the href value to nothing ("") and it still shows the href as the current ad url when you hover the mouse over the link and click redirects to the same page.

My question is: How do i change this to a custom URL ?

I hope it makes some sense. Adding a picture to show a bit better.

Thank you.

Image Enlarger

February 21, 2019
10:06 am
pizzalover
New Member
Members
Forum Posts: 2
Member Since:
February 21, 2019
sp_UserOfflineSmall Offline

So i found a way around that weird behaviour but would like to know what caused it, is it on purpose or a bug?

What i did:

<a href="http://mysite.com/user/$adcontact_name"><button>Contact</button></a>

February 22, 2019
9:55 am
AWPCP Support
Moderator
Members

Moderators
Forum Posts: 5335
Member Since:
September 4, 2013
sp_UserOfflineSmall Offline

Hi pizzalover,

Thanks for your post and your kind words. I'm checking with the developer on this to be sure, and I'll let you know once I hear back. I'm glad you were able to sort this out for now! 

February 25, 2019
10:28 am
AWPCP Support
Moderator
Members

Moderators
Forum Posts: 5335
Member Since:
September 4, 2013
sp_UserOfflineSmall Offline

Hi pizzalover,

Thanks for your patience here.

I just heard back from the developer regarding the issue you reported, and here is what he said:
---------------------------------------

> If i change the href value to $adcontact_name in the ad/listing settings in the dashboard it appears to prepend the ad listing's url to it, also tried to change the href value to nothing ("") and it still shows the href as the current ad url when you hover the mouse over the link and click redirects to the same page.

In HTML an `<a>` element with an empty `href` attribute points to the current URL automatically. That's why the browser shows the ad URL when you hover the mouse over the link.

Similarly, using `$adcontact_name` creates a relative URL so the browser has to turn that into an absolute URL by prepending part of the URL of the current page.

> What i did:
> ```
> <a href="http://mysite.com/user/$adcontact_name"><button>Contact</button></a>
> ```

I think this works as long as `$adcontact_name` matches the username of one of the website's users. However, that may not be the case all the time. `$adcontact_name` could be something like "John Doe" and in that case I don't think the URL would work.

Unfortunately we don't have a placeholder that can return the username or ID of the owner of the ad, so I can't provide a better solution either.

---------------------------------------

Forum Timezone: America/Denver

Most Users Ever Online: 163

Currently Online:
13 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Johnny B: 140

godie: 120

kerdezo: 99

laburke: 94

NAIN KHAN: 93

salvig67: 84

rude: 72

purplepaula: 72

WAYTOBAYWTB52: 71

gery: 71

Member Stats:

Guest Posters: 32

Members: 38081

Moderators: 2

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 7021

Posts: 31228

Newest Members:

Cherry39, Odie Wolfe, ahikudeni, KO, Roberto, Antnan, ilyjegupi, Kenneth, Yuri, MOHAMED SANI

Moderators: awpcp: 7530, AWPCP Support: 5335

Administrators: wpengine: 0, awpcp: 300

Skip to toolbar