Karry.Stewart 0 Newbie Poster

Hi, I've a site and it has a News webpage, called something like www.website.com/news/detail/id/3. Now when I try to share this on any social media sites it is taking the title of www.website.com for any of the news details I share, i.e only one title of the website. I want to share News detail page URL to be shared in a way that when a user clicks it it should directly goto that news details page that is dynamically created on addition of every news in MySQL. I'm struggling to solve this and want anyone who has a clear idea on how to set the particular News title to be shared using a url link of that news detail page on any of the social network sites. Eg.. as said above sppose I've a News Title lets say "Welcome to Daniweb, the website for every technology to technocrats" and its url is www.website.com/news/detail/id/4

When I share or post the above link it should show the news title as "Welcome to Deniweb, etc... followed by some part of news detail or description or image in that article. I hope you might have a clear idea about this. I know its a generic one yet need your help please.

My queries are:
1. How to change the id No. '4' to News_title in the link and
2. How to share the news title using link for its each url that is dynamically created.
This is how the code I've crafted and lost in it, not sure where I'm going wrong. Please Help...

Start of the .../news/detail.phtml page is as follows:

<? $this->headScript()->appendFile($this->baseUrl().'/public/js/jquery.js')
->appendFile($this->baseUrl().'/public/js/thickbox.js');?>
<?php $this->headLink()->appendStylesheet($this->baseUrl().'/public/css/thickbox.css');?>

<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5084654d11c9b0da"></script>
<!-----CRUMB STARTS----->
<div class="contentpad">
<div class="headingpad" style="padding:10px 0 0 0;">
    <div class="clearfix">
        <h2>News</h2>
    </div>
</div>

<!-----CRUMB ENDS----->
<!------------------------ CONTENT STARTS------------------------>

<div class="newsviewwholepad">

    <div class="leftcol">
        <div class="textnews"><br/>
            <div class="floatleft"><h2><a><?echo $this->queryresult[0]['News_Title'];?></a></h2>
            <pa>By: <?echo $this->queryresult[0]['News_Editor'];?>, 
            Published: <?echo $this->queryresult[0]['Published_Date'];?></pa>

            </div><br/><br/>

            <div class="floatright">
                <ul class="clearfix">
                    <li style="float:left;padding:0 6px 0 0;">
                        <img src="<?php echo $this->baseUrl(); ?>/public/images/emailimg.jpg" width="14" height="11"/>
                        <a style="color:#666;" href="<?php echo $this->baseUrl()."/news/email/id/".$this->id."?keepThis=true&TB_iframe=true&height=480&width=380"; ?>" class="thickbox" >Email</a>
                    </li>
                    <li style="float:left;padding:0 6px 0 0;">
                        <img src="<?php echo $this->baseUrl(); ?>/public/images/plusimg.jpg" width="14" height="11"/>
                        **<a style="color:#666;" href="http://www.addthis.com/bookmark.php?v=300" onmouseover="return addthis_open(this, '', '[URL]', '[News_Title]')" onmouseout="addthis_close()" onclick="return addthis_sendto()">Share</a>**

                    </li>
                    <li style="float:left;padding:0 6px 0 0;"><img src="<?php echo $this->baseUrl(); ?>/public/images/printimg.jpg" width="14" height="11"/><a style="color:#666;" href="JavaScript:window.print();">Print</a></li>
                </ul>
            </div>

            <div class="clear"></div>
            <a href="<?php echo $this->baseUrl(); ?>/news" title="Top News"><img src="<?php echo $this->baseUrl(); ?>/public/images/goback.png" width="48" height="20" alt=""/></a>

            <p><? echo $this->queryresult[0]['News_Content'];?>
            </p>

        </div>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.