Current location: Hot Scripts Forums » Programming Languages » PHP » [SOLVED] Printing


[SOLVED] Printing

Reply
  #1 (permalink)  
Old 07-04-08, 08:44 PM
Psybadek Psybadek is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Florida
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Printing

OK, in a project of mine Im working on the smilies. The templates are done with HTML files so I can't use php in PHP tags, it's coded for variables inside { } tags.

So before I echo the template, Im starting a query for smilies so it will grab them

Heres what I got.

PHP Code:

    $load_smilie2 $db->query ("SELECT * FROM smilies ORDER BY sid");

    while (
$smile2 $db->fetch_array ($load_smilie2)) {
        
        
$url "<img src='$smile2[url]' alt='Smilie' border='0' />";
        
$key $smile2['replacekey'];
        
$smilie "<a href='#' onclick=\"insert_text('{$key}', '')\">{$url}</a>";

}            
    echo eval(
grab_template('new','newreply')); 
With this method it will only print 1 smilie, not all of them.

If I go this route:

PHP Code:

function smilies() {

    
    

    
$load_smilie2 mysql_query ("SELECT * FROM smilies ORDER BY sid");
    while (
$smile2 mysql_fetch_array ($load_smilie2)) {
        
        
$url "<img src='$smile2[url]' alt='Smilie' border='0' />";
        
$key $smile2['replacekey'];
        
    
        
$smilie "<a href='#' onclick=\"insert_text('$key', '')\">$url</a>";

print 
$smilie;
}

}


$smil 'smilies'
then I can do {$smil()} and it will print them all, just not in the right spot.

Anyone have any idea's?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing in a dot matrix printer changes the top margin and left margin Ork Visual Basic 4 02-18-06 11:35 AM
Printing Tickets phppick PHP 3 06-16-05 04:03 AM
Printing Event? Naresh Rohra Visual Basic 2 09-24-04 04:15 PM
Automated Digital Printing System amberpro Job Offers & Assistance 1 07-10-04 06:22 PM
essential business & printing supplies digital print General Advertisements 0 03-29-04 06:05 AM


All times are GMT -5. The time now is 07:49 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.