Jump to content

Trek15

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Trek15's Achievements

Member

Member (2/5)

0

Reputation

  1. Hmm, but all the other "functions" or whatever are in the parenthesis of apply_filters, like here: return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback ); So doesn't that mean that apply_filters just is a function that starts the other functions?
  2. Hi guys. As per usual when the official forums of software like Wordpress gives you no help whatsoever i come to the only community that always gave me great help in the past! This time i'm trying to get WP to allow hyphens and underscores in the username. There is one topic in their forum explaining that commenting some code could help, but it didn't for me in the latest version. I have no idea what this code is or how it works (or even if it's there to allow or disallow), but as i've seen many other requests for help for this type of code in this board i try here: /** * Sanitize username stripping out unsafe characters. * * Removes tags, octets, entities, and if strict is enabled, will only keep * alphanumeric, _, space, ., -, @. After sanitizing, it passes the username, * raw username (the username in the parameter), and the value of $strict as * parameters for the 'sanitize_user' filter. * * @since 2.0.0 * @uses apply_filters() Calls 'sanitize_user' hook on username, raw username, * and $strict parameter. * * @param string $username The username to be sanitized. * @param bool $strict If set limits $username to specific characters. Default false. * @return string The sanitized username, after passing through filters. */ function sanitize_user( $username, $strict = false ) { $raw_username = $username; $username = wp_strip_all_tags( $username ); $username = remove_accents( $username ); // Kill octets $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username ); $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities // If strict, reduce to ASCII for max portability. if ( $strict ) $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username ); $username = trim( $username ); // Consolidate contiguous whitespace $username = preg_replace( '|\s+|', ' ', $username ); return apply_filters( 'sanitize_user', $username, $raw_username, $strict ); } The wierd thing is that it clearly states that.. "will only keep alphanumeric, _, space, ., -, @." , which it obviously doesn't. The code that i think is what you can modify to allow hyphens and underscores is the one under "//Kill octets". Does anyone have any idea what i could add there to make this happen? Simply commenting out that code for some reason still only allows numbers and letters in usernames during the registration on my website.
  3. I'll try this again. How do you pull the username from the currently logged in user in Joomla 1.7? I believe this is called a "hook" among you coder folk. Kind of embarassing that i have to ask this here since nobody can answer it even in the official Joomla forum. The devs for that software really need to slow down a bit and start finishing up on the documentation before they add even more to Joomla.
  4. TradeDoubler ads have this feature called EPI, Enchaned Publisher Integration, which is an optional way of adding more information to a click/purchase on a banner in a manner of keeping track of which user on your website that actually made the click/purchase. Considering it apparently doesn't need to be that complex, i would like to ask if anyone here would know what Joomla's version would be for the EPI code. This is apparently how it works: EPI requires one parameter, which you append to the TradeDoubler tracking URL. EPI is the parameter, which distinguishes the visitor. The logic behind EPI supposes that you know who the visitor is when he/she clicks on the tracker link. Normally you would have some kind of script that inserts the EPI value, depending on the identity of the visitor, into the tracker link. The EPI parameter does not need to be registered, or created in the TradeDoubler system prior to you appending the EPI parameter to a TradeDoubler tracking URL. TradeDoubler tracking technology will automatically record any EPI parameter you have appended to a tracking URL or banner, however avoid using spaces and punctuation marks in the EPI code. The simple solution is to make a small form of your tracker link. Because the links look something like "http://clk.tradedoubler.com/click?p=XXXX&a=XXXX&g=XXXX" you can also make a form containing all values in the link. These values are sent with METHOD=GET to http://clk.tradedoubler.com. For example: <form method="get" action="http://clk.tradedoubler.com"> <input type="hidden" name="p" value="XXXX"> <input type="hidden" name="a" value="XXXX"> <input type="hidden" name="g" value="XXXX"> </form> If you for example let your visitors type in their e-mail address you can add this to the form: <input type="text" name="epi"> A more interesting part is however this: If you instead want to create an automatic system you can let the visitors log in on your site and let code add EPI values to each ad-link that way. By adding &epi=username for example. This is obviously the Joomla-specific code that i'm looking for. Here is a sample ad-link: <a href=”http://clkuk.tradedoubler.com/click?p(702)a(407311)g(15036) epi(myEpiCode)”>Click here for great offers</a> The "myEpiCode" is obviously where the Joomla-specific code should go. Anyone wanna give it a shot? I'd try your suggestions on my site to see if it gets sent properly to the reports in my TD account.
  5. Hello folks! As per usual when i can't find any help elsewhere i come here. The Joomla forum's coding support is lacking to say the least, while this place always has experienced people interested in helping! I use a flash menu software that isn't coded for Joomla but that has a fully functioning module available for it to make it simple to add it to your Joomla site. The problem is that everyone can see all items on this menu since the items are defined in an XML document and since they thereby don't take any access levels into consideration. This means that i have to create menu items in Joomla first and then add the links to those menus in the custom XML file for them to show up in the flash menu. And if i make any of those menu items inaccessible to guests they see a 404 error page instead of being told to log in when they click it, which i realize is due to the page of such menu items not actually existing since Joomla generates all pages to those with rights to acces them. So, i wonder if anyone knows how you can make those menu items conditional to access levels or user groups in Joomla by placing code around them. I'm not interested in customizing the 404 page. I don't want them to have to see that page at all. And for that i have to hide the menu items from them somehow.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.