<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Remove record num from _link</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Remove-record-num-from-_link-71841</link>
        <description></description>
        <pubDate>Sat, 11 Jul 2026 19:19:45 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Remove-record-num-from-_link-71841" rel="self" type="application/rss+xml" />

                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218776#post2218776</link>
          <description><![CDATA[Hi Kevin,<br /><br />What was happening is that the value stored in the database was &quot;Acorn Lodge &quot; but we were searching for &quot;Acorn_Lodge&quot;, which doesn't take allow for the trailing space at the end.  Using TRIM(address) removes the trailing space, so we are then comparing &quot;Acorn Lodge&quot; to  &quot;Acorn_Lodge&quot;.  The &quot;_&quot; is a MySQL is a wildcard that can represent any character, in this case a space.  So these two strings are now the same.<br /><br />Hope this helps.  Please let me know if you have any other questions.<br /><br />Thanks,<br /><br /><br />]]></description>
          <pubDate>Wed, 12 Dec 2012 11:14:27 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218776#post2218776</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218774#post2218774</link>
          <description><![CDATA[Jason thanks!  That looks like it's working.<br /><br />Any ideas what was happening?  Still not sure I completely understand all the preg_replace code.<br /><br />Thanks for the help!<br /><br />-Kevin<br />]]></description>
          <pubDate>Wed, 12 Dec 2012 10:59:26 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218774#post2218774</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218772#post2218772</link>
          <description><![CDATA[Hi Kevin,<br /><br />There isn't a trim taking place, since the only difference between the 2 tests is the presence of a trailing space inside the record, which wouldn't appear in the query.  One thing you can try is to trim the address field in the database from inside your where clause like this:<br /><br /><code> // load records<br />list($listingsRecords, $listingsMetaData) = getRecords(array(<br />  'tableName' =&gt; 'listings',<br />  'where' =&gt; &quot; TRIM(address) LIKE '&quot;.mysql_escape($title_like).&quot;'&quot;,<br />  'limit' =&gt; '1',<br />));</code><br /><br />This should remove any leading or trailing spaces before the LIKE comparison is done.<br /><br />Hope this helps]]></description>
          <pubDate>Wed, 12 Dec 2012 10:41:13 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218772#post2218772</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218770#post2218770</link>
          <description><![CDATA[Jason,<br /><br />Ok, with the trim NOT in the script....and the record having NO trailing spaces in the Title in the CMS.....this is the resulting query (which works):<br /><br />SELECT SQL_CALC_FOUND_ROWS `property_listings`.*<br />FROM `cms_property_listings` as `property_listings`<br /> WHERE (property_name LIKE 'Acorn_Lodge') <br /> ORDER BY SUBSTRING_INDEX(property_name,'The ',-1)<br /> LIMIT 1<br />tableName = 'property_listings' AND<br />fieldName IN ('photos') AND<br />recordNum IN (4)<br /> ORDER BY `order`, num<br />SELECT SQL_CALC_FOUND_ROWS `accounts`.*<br />FROM `cms_accounts` as `accounts`<br /> WHERE (`num` IN (1)) <br /> ORDER BY fullname, username<br /><br /><br />Now, if I just add a space to the end of the record title in the CMS....I then get this query:<br /><br />SELECT SQL_CALC_FOUND_ROWS `property_listings`.*<br />FROM `cms_property_listings` as `property_listings`<br /> WHERE (property_name LIKE 'Acorn_Lodge') <br /> ORDER BY SUBSTRING_INDEX(property_name,'The ',-1)<br /> LIMIT 1<br />Warning: Cannot modify header information - headers already sent by (output started at /home/lmdianet/public_html/mmp/cmsAdmin/lib/viewer_functions.php:411) in /home/lmdianet/public_html/mmp/cmsAdmin/lib/common.php on line 1063 Record not found!<br /><br /><br />Looks to me like something IS trimming this already, even though I haven't added the TRIM to the link.<br /><br />-Kevin<br />]]></description>
          <pubDate>Wed, 12 Dec 2012 10:15:57 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218770#post2218770</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218768#post2218768</link>
          <description><![CDATA[Hi Kevin,<br /><br />To get a better idea of exactly what's happening, try putting a debugSql option in your getRecords call:<br /><br /><code> // load records<br />list($listingsRecords, $listingsMetaData) = getRecords(array(<br />  'tableName' =&gt; 'listings',<br />  'where' =&gt; mysql_escapef('address LIKE ?', $title_like),<br />  'limit' =&gt; '1',<br />  'debugSql'  =&gt;  '1',<br />));</code><br /><br />This will print out the exact query being executed.  If you could post this along with the exact value of the address field in the record you are expecting to retrieve.  That should point us in the right direction.<br /><br />Thanks]]></description>
          <pubDate>Wed, 12 Dec 2012 10:10:41 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218768#post2218768</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218765#post2218765</link>
          <description><![CDATA[Jason thanks.<br /><br />Technically that does help.  Forgot I could just trim the string.  However, I think I'm thinking of this incorrectly, because even when I trim the string, the CMS still doesn't find the record.  I'm guessing because the record itself HAS the spaces, therefore the LIKE isn't matching?<br /><br />I guess, can someone explain to be exactly what these preg_replace statements are doing?  Maybe that will help me understand how to tackle this.<br /><br /><br />These are on the list page to form the link:<br /><br />$propertyLink = preg_replace('/[^a-z0-9\.\-\_]/i', '-', $record['property_name']);<br />$propertyLink = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $propertyLink);<br /><br /><br />These are on the detail page:<br /><br />$title_like = preg_replace(&quot;/_/&quot;, '\\_', @$_SERVER['QUERY_STRING']); <br />$title_like = preg_replace(&quot;/-/&quot;, '_', $title_like); <br /><br /><br />Thanks for any help.<br /><br />-Kevin<br />]]></description>
          <pubDate>Wed, 12 Dec 2012 09:44:37 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218765#post2218765</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218749#post2218749</link>
          <description><![CDATA[Hi Kevin,<br /><br />You can use the PHP function trim() to do this, for example:<br /><br /><code>$query_string = trim ( preg_replace('/[^a-z0-9\.\-\_]/i', '-', $record['title']) );</code><br /><br />Hope this helps,<br />]]></description>
          <pubDate>Tue, 11 Dec 2012 11:06:40 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218749#post2218749</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218747#post2218747</link>
          <description><![CDATA[Hey Chris,<br /><br />Your code is working great.  I do have one more question.....is there anyway to have the code strip out or ignore trailing spaces in the title field?  We have some clients that inadvertently space an extra space at the end....this causes this link method to not find the record.<br /><br />Can this be done in the preg_replace.....or is there a way in the admin to strip out any trailing spaces?<br /><br />Thanks!<br /><br />-Kevin<br />]]></description>
          <pubDate>Tue, 11 Dec 2012 06:54:10 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218747#post2218747</guid>
        </item>
                <item>
          <title>Re: [Chris] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218612#post2218612</link>
          <description><![CDATA[I'll have to test some more but right now it looks to be working.  Thanks Chris!!<br /><br />-Kevin<br />]]></description>
          <pubDate>Mon, 26 Nov 2012 19:27:30 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218612#post2218612</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218611#post2218611</link>
          <description><![CDATA[Hi Kevin,<br /><br />Thanks for the details! I think what's happening here is that the adjacent space and number sign (&quot; #&quot;) in &quot;1234 Main Street #3&quot; are getting turned into a single hyphen (&quot;-&quot;) in the link, and that's being turned into a LIKE expression which is only looking for one character there (e.g. LIKE &quot;1234_Main_Street_3&quot;).<br /><br />I think the simplest solution here is to not truncate adjacent hyphens into one. Wherever you're generating links, remove the plus sign from this regular expression:<br /><br /><code>$query_string = preg_replace('/[^a-z0-9\.\-\_]<span style="color:red"><b>+</b></span>/i', '-', $record['title']);</code><br /><br />It should look like this instead:<br /><br /><code>$query_string = preg_replace('/[^a-z0-9\.\-\_]/i', '-', $record['title']);</code><br /><br />That should cause your link to have an extra hyphen in it, like this: /home-listings-detail.php?1234-Main-Street--3<br /><br />Does that help?<br />]]></description>
          <pubDate>Mon, 26 Nov 2012 19:23:20 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218611#post2218611</guid>
        </item>
                <item>
          <title>Re: [Chris] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218610#post2218610</link>
          <description><![CDATA[Can't give a URL right now because I'm on a protected server.<br /><br />I can give you my details.<br /><br />I have 2 pages, a listings page and a detail page.<br /><br />On the listings page, within the foreach loop I create a link as follows:<br /><br /><code>&lt;?php <br />$propertyLink = preg_replace('/[^a-z0-9\.\-\_]+/i', '-', $record['address']);<br />$propertyLink = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $propertyLink);<br />?&gt;</code><br /><br />I then for each record create the manual URL like this:<br /><br />&lt;a href=&quot;/home-listings-detail.php?&lt;?php echo $propertyLink ?&gt;&quot;&gt;LINK&lt;/a&gt;<br /><br />For a record that has a property address of 1234 Main Street, I get the nice URL of this:  /home-listings-detail.php?1234-Main-Street<br /><br />On the detail page, at the top I have the following:<br /><br /><code>&lt;?php<br /><br />  //CODE USED TO REMOVE THE RECORD num from the URL<br />  $title_like = preg_replace(&quot;/_/&quot;, '\\_', @$_SERVER['QUERY_STRING']); <br />  $title_like = preg_replace(&quot;/-/&quot;, '_', $title_like); <br /><br />  // load records<br />  list($listingsRecords, $listingsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'listings',<br />    'where'       =&gt; mysql_escapef('address LIKE ?', $title_like),<br />    'limit'       =&gt; '1',<br />  ));<br />  $listingsRecord = @$listingsRecords[0]; // get first record<br /><br />  // show error message if no matching record is found<br />  if (!$listingsRecord) {<br />    header(&quot;HTTP/1.0 404 Not Found&quot;);<br />    print &quot;Record not found!&quot;;<br />    exit;<br />  }<br /><br />?&gt;</code><br /><br />For that test URL of /home-listings-detail.php?1234-Main-Street, the code works fine.  It's loads the detail page.<br /><br />However, if I change the property address to 1234 Main Street #3, the url it wants to go to is:  /home-listings-detail.php?1234-Main-Street-3<br /><br />For the detail page I get the error thrown from the CMS:  Record not found!<br /><br /><br />Hope that helps.....let me know.<br /><br />-Kevin<br />]]></description>
          <pubDate>Mon, 26 Nov 2012 19:07:49 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218610#post2218610</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218609#post2218609</link>
          <description><![CDATA[Hi kblm,<br /><br />What code exactly are you using at the top of your page, and can you provide the example URL that is being generated for &quot;1 Main Street #3&quot; and failing to find the record?<br /><br />Thanks,<br />Chris<br />]]></description>
          <pubDate>Mon, 26 Nov 2012 18:59:24 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218609#post2218609</guid>
        </item>
                <item>
          <title>Re: [Chris] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2218608#post2218608</link>
          <description><![CDATA[Resurrecting this old thread because I've run into an issue that I'm wondering if it can be solved.<br /><br />This code works fine.....as long as the record title doesn't end in a number.<br /><br />I'm running across this issue with some real estate clients.  We might have a record like:   1 Main Street #3<br /><br />In this case, the code fails, I'm guessing because now it's looking for a number.  <br /><br />Any ideas if there is a workaround?<br /><br />Thanks!<br /><br />-Kevin<br />]]></description>
          <pubDate>Mon, 26 Nov 2012 18:53:45 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2218608#post2218608</guid>
        </item>
                <item>
          <title>Re: [Jason] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207690#post2207690</link>
          <description><![CDATA[That did the trick....Thanks for your help Jason.<br />]]></description>
          <pubDate>Wed, 27 Oct 2010 12:01:22 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207690#post2207690</guid>
        </item>
                <item>
          <title>Re: [rgc] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207689#post2207689</link>
          <description><![CDATA[Hi,<br /><br />What's happening is you are echoing $query_string in 2 places, where you only need to be echoing it in one.<br /><br />Remove the line indicated below:<br /><br /><code>&lt;body&gt;&lt;?php foreach ($aboutRecords as $record): ?&gt;<br />&lt;?php<br />$query_string = preg_replace('/[^a-z0-9\.\-\_]+/i', '-', $record['title']);<br />$query_string = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $query_string);<br /><strike>echo $query_string;</strike><br />?&gt;<br />| &lt;a href=&quot;about.htm?&lt;?php echo $query_string;?&gt;&quot;&gt;&lt;?php echo $record['title'] ?&gt;&lt;/a&gt;<br />&lt;?php endforeach; ?&gt;<br /><br />&lt;/body&gt;</code><br /><br />Hope this helps.<br />]]></description>
          <pubDate>Wed, 27 Oct 2010 11:51:39 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207689#post2207689</guid>
        </item>
                <item>
          <title>Re: [Jason] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207688#post2207688</link>
          <description><![CDATA[I appreciate your help Jason....we are almost there. <br />The correct link is now appearing, however i can not figure out what is causing the page title to be duplicated, first just title no link, then title with the link, looks like this :<br />Page-One | Page-One  Page-Two | Page-Two  Page-Three | Page-Three<br /><br />How do i correct this? Thanks! <br /><br />Here is my latest body code:<br />&lt;body&gt;&lt;?php foreach ($aboutRecords as $record): ?&gt;<br />&lt;?php <br />  $query_string = preg_replace('/[^a-z0-9\.\-\_]+/i', '-', $record['title']); <br />  $query_string = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $query_string); <br />  echo $query_string; <br />?&gt;<br />      | &lt;a href=&quot;about.htm?&lt;?php echo $query_string;?&gt;&quot;&gt;&lt;?php echo $record['title'] ?&gt;&lt;/a&gt;<br />            &lt;?php endforeach; ?&gt;<br />    <br />&lt;/body&gt;<b><br />]]></description>
          <pubDate>Wed, 27 Oct 2010 11:45:31 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207688#post2207688</guid>
        </item>
                <item>
          <title>Re: [rgc] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207686#post2207686</link>
          <description><![CDATA[Hi,<br /><br />The code to create the $query_string variable needs to take place inside the foreach loop like this:<br /><br /><code>&lt;body&gt;  &lt;?php foreach ($aboutRecords as $record): ?&gt;<br /><span style="color:red"><br />$query_string = preg_replace('/[^a-z0-9\.\-\_]+/i', '-', $record['title']);<br />$query_string = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $query_string);<br /></span><br />| &lt;a href=&quot;about.htm?&lt;?php echo $query_string;?&gt;&quot;&gt;&lt;?php echo $record['title'] ?&gt;&lt;/a&gt;<br />&lt;?php endforeach; ?&gt;</code><br /><br />Hope this helps.<br />]]></description>
          <pubDate>Wed, 27 Oct 2010 11:28:29 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207686#post2207686</guid>
        </item>
                <item>
          <title>Re: [Jason] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207683#post2207683</link>
          <description><![CDATA[All the navigation links are now appearing the same - http://www.mylcient.com/about.htm?<br /><br />What needs to be changed or added to get the title field to display after the ? <br />Here is my complete page code:<br />&lt;?php header('Content-type: text/html; charset=utf-8'); ?&gt;<br />&lt;?php <br />  $query_string = preg_replace('/[^a-z0-9\.\-\_]+/i', '-', $record['title']); <br />  $query_string = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $query_string); <br />  echo $query_string; <br />?&gt;<br />&lt;?php<br />  // load viewer library<br />  $libraryPath = 'cm/lib/viewer_functions.php';<br />  $dirsToCheck = array('/usr2/home/myclient.com/htdocs/','','../','../../','../../../');<br />  foreach ($dirsToCheck as $dir) { if (@include_once(&quot;$dir$libraryPath&quot;)) { break; }}<br />  if (!function_exists('getRecords')) { die(&quot;Couldn't load viewer library, check filepath in sourcecode.&quot;); }<br /><br />  // load records<br />  list($aboutRecords, $aboutMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'about',<br />  ));<br /><br />?&gt;<br />&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />&lt;head&gt;<br />&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;<br />&lt;title&gt;Untitled Document&lt;/title&gt;<br />&lt;/head&gt;<br /><br />&lt;body&gt;   &lt;?php foreach ($aboutRecords as $record): ?&gt;<br />      | &lt;a href=&quot;about.htm?&lt;?php echo $query_string;?&gt;&quot;&gt;&lt;?php echo $record['title'] ?&gt;&lt;/a&gt;<br />            &lt;?php endforeach; ?&gt;<br />    &lt;/p&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;<br />]]></description>
          <pubDate>Wed, 27 Oct 2010 11:19:07 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207683#post2207683</guid>
        </item>
                <item>
          <title>Re: [rgc] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207680#post2207680</link>
          <description><![CDATA[Hi,<br /><br />You would use the same code that Chris posted to just use the title for your link:<br /><code>&lt;?php <br />  $query_string = preg_replace('/[^a-z0-9\.\-\_]+/i', '-', $record['title']); <br />  $query_string = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $query_string); <br />?&gt;</code><br /><br />The variable $query_string is what you would append to your .php page in the link like this:<br /><br /><br /><code>&lt;a href=&quot;myPage.php?&lt;?php echo $query_string;?&gt;&quot;&gt;Link&lt;/a&gt;</code><br /><br />Hope this helps.<br />]]></description>
          <pubDate>Wed, 27 Oct 2010 10:38:12 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207680#post2207680</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207676#post2207676</link>
          <description><![CDATA[This worked well on my clients site also. However on the actual detail page, I have a viewer displaying links to other related sub pages - what code do i use to modify the &lt;?php echo $record['_link'] ?&gt; links so it will display the link without the number as well?: <br /><br />This is the code i have used to display navigation links to the other pages in the about section:<br /> &lt;?php<br />  // load viewer library<br />  $libraryPath = 'cm/lib/viewer_functions.php';<br />  $dirsToCheck = array('/usr2/home/clientsdomain.com/htdocs/','','../','../../','../../../');<br />  foreach ($dirsToCheck as $dir) { if (@include_once(&quot;$dir$libraryPath&quot;)) { break; }}<br />  if (!function_exists('getRecords')) { die(&quot;Couldn't load viewer library, check filepath in sourcecode.&quot;); }<br /><br />  // load records<br />  list($aboutRecords, $aboutMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'about',<br />  ));<br /><br />?&gt;<br />            &lt;?php foreach ($aboutRecords as $record): ?&gt;<br />      | &lt;a href=&quot;&lt;?php echo $record['_link'] ?&gt;&quot;&gt;&lt;?php echo $record['title'] ?&gt;&lt;/a&gt;<br />            &lt;?php endforeach; ?&gt;<br />]]></description>
          <pubDate>Wed, 27 Oct 2010 09:52:24 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207676#post2207676</guid>
        </item>
                <item>
          <title>Re: [chris] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207398#post2207398</link>
          <description><![CDATA[Chris,<br /><br />Thanks.  This worked.<br /><br />-Kevin<br />]]></description>
          <pubDate>Tue, 12 Oct 2010 09:08:22 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207398#post2207398</guid>
        </item>
                <item>
          <title>Re: [kblm] Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207385#post2207385</link>
          <description><![CDATA[Hi Kevin,<br /><br />You'll need to manually construct the link, yes.<br /><br />One thing to keep in mind is that when CMS Builder generates those URLs, it replaces all characters that are not in the set [a-z0-9._] with hyphens, therefore, (theoretically) many different titles could turn into &quot;ADAMS-ELEMENTARY-SCHOOL&quot;.<br /><br />You can use this code to generate a link like CMS Builder does:<br /><br /><code>&lt;?php<br />  $query_string = preg_replace('/[^a-z0-9\.\-\_]+/i', '-', $record['title']);<br />  $query_string = preg_replace(&quot;/(^-+|-+$)/&quot;, '', $query_string);<br />  echo $query_string;<br />?&gt;</code><br /><br />Then, on your detail page, you'll need to replace the hyphens with underscores to be able to match any character in their place (but not before escaping your existing underscores:)<br /><br /><code>  $title_like = preg_replace(&quot;/_/&quot;, '\\_', @$_SERVER['QUERY_STRING']);<br />  $title_like = preg_replace(&quot;/-/&quot;, '_', $title_like);<br />  <br />  list($sampleRecords, $sampleMetaData) = getRecords(array(<br />    'tableName'     =&gt; 'sample',<br />    'where'         =&gt; mysql_escapef('title LIKE ?', $title_like),<br />  ));<br />  $sampleRecord = @$sampleRecords[0]; // get first record</code><br /><br />I hope this helps! Please let me know if you have any questions.<br />]]></description>
          <pubDate>Mon, 11 Oct 2010 23:58:34 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207385#post2207385</guid>
        </item>
                <item>
          <title>Remove record num from _link</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2207372#post2207372</link>
          <description><![CDATA[If I have a multi record section where the Title field has to be unique, is there anyway to not have the -num be appended to the url string?<br /><br />So I have a page with a bunch of local school listings.  Instead of having the url be:<br /><br />/schooldetail.php?ADAMS-ELEMENTARY-SCHOOL-1<br /><br />I'd like it to be:<br />schooldetail.php?ADAMS-ELEMENTARY-SCHOOL<br /><br />Is this possible?  Do I have to manually construct the link?  Since I am making the Title field unique, I'm hoping I can use just the Title in the URL.<br /><br />Thanks.<br /><br />-Kevin<br />]]></description>
          <pubDate>Mon, 11 Oct 2010 17:10:24 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2207372#post2207372</guid>
        </item>
              </channel>
    </rss>
  