KDM Posted June 28, 2011 Share Posted June 28, 2011 I have a picture sharing site that allows users to post the pictures into forums using code like this. How can I add an image alt tag to this code? When the images are posted in forums I want my alt tag to be my keyword. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/ Share on other sites More sharing options...
requinix Posted June 28, 2011 Share Posted June 28, 2011 Alter whatever BBCode parser you're using to include an alt attribute for the image. Not sure how? Post code. Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1235739 Share on other sites More sharing options...
KDM Posted June 28, 2011 Author Share Posted June 28, 2011 Alter whatever BBCode parser you're using to include an alt attribute for the image. Not sure how? Post code. [url=http://www.*************.net][img=http://www.*************.net/uploads/1772.jpg][/url] Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1235783 Share on other sites More sharing options...
requinix Posted June 28, 2011 Share Posted June 28, 2011 Not that. The code that converts the BBCode into HTML. Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1236079 Share on other sites More sharing options...
KDM Posted June 29, 2011 Author Share Posted June 29, 2011 Not that. The code that converts the BBCode into HTML. That's the code the users post into forums to post my images Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1236188 Share on other sites More sharing options...
Adam Posted June 29, 2011 Share Posted June 29, 2011 That's the BBCode users enter. requinix was asking for the PHP code that parses the BBCode. Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1236189 Share on other sites More sharing options...
KDM Posted June 29, 2011 Author Share Posted June 29, 2011 That's the BBCode users enter. requinix was asking for the PHP code that parses the BBCode. oh ok. $d[]="<div style='margin-left:auto; margin-right:auto;'> <p style='padding:0; margin:0; margin-right:20px; text-align:center; font-size:14px;'><a href='force.php?path=uploads/".$imgs[0]->link."'> Click to Download Image</a></p><br /> ".$thelarge." <div style='overflow:auto; clear:both'> <div style='margin-left:auto; margin-right:auto;'> Image: <span style='color:#FFFFFF;'>{$imgs[0]->name}</span><br /> <span style='color:#ffffff; font-size:13px;'>Posted on: ".date('m-d-Y',$imgs[0]->date_added)." by ".ucfirst($theuser)."</span> </div> </div> <div style='margin-left:auto; margin-right:auto; margin-top:5px;'> <!-- Insert unique view count --> <span style='color:#ffffff; font-size:13px;'>Views: $_views</span> </div> <div style='font-size:12px; margin-top:30px; margin-left:5px;'> ".'Share Link<br /><input name="textfield3" type="text" class="imagedetails_links" id="textfield3" onclick="this.select();this.focus()" value=http://www.******.net/uploads/'.$imgs[0]->link.'><br /> For posting in forums use this:<br /> <input name="textfield6" type="text" class="imagedetails_links" id="textfield6" onclick="this.select();this.focus()" value="[url=http://www.******.net][img=http://www.******.net/uploads/'.$imgs[0]->link.'][/url]" size="70" /> <br /> </div> '; Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1236464 Share on other sites More sharing options...
Adam Posted June 29, 2011 Share Posted June 29, 2011 I'm not really sure what that is. Do you have any experience with PHP? Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1236470 Share on other sites More sharing options...
KDM Posted June 30, 2011 Author Share Posted June 30, 2011 Yes I do. No expert though. Quote Link to comment https://forums.phpfreaks.com/topic/240574-alt-tag/#findComment-1236615 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.