Jump to content

eevan79

Members
  • Posts

    240
  • Joined

  • Last visited

    Never

Everything posted by eevan79

  1. Hi, I have simple problem. I want to open php code in new window. Here is my code: <li><?php comment_author_link() ?> </li> How to open this comment_author_link in new window? Thanks.
  2. Hi all, I found some usefull instructions to SMF registed users can post on wordpress blog (using SSI.php). Problem is when I am logged on Wordpress and SMF in same time (different account) I can see under comments form "Logged as <SMF user>", but when I submit comment, it's from Wordpress user (account). Script first check if you are logged as SMF user, than Wordpress user. 1. I want to display both logins info (if exists) under comment form. (I think its simple fix, but I can't make it to work. ) For example: Logged as <Wordpress account>. Forum user: <SMF account> [Comment form] 2. I dont know if it's possible to add value (in url) link to SMF user profile. <input type="hidden" name="url" id="url" value="LINK_TO_SMF_USER_PROFILE" size="40" tabindex="3" /></p> This is my script (first I include SSI.php) <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <?php //Get username + email from SMF... global $context; if ($context["user"]["is_logged"]) { ?> <p>Forum login: <strong><font color="yellow"><?php echo $context["user"]["name"]; ?>. <?php ssi_logout()?>.</p></font></strong> <input type="hidden" name="author" id="author" value="<?php echo $context["user"]["name"]; ?>"/> <input type="hidden" name="email" id="email" value="<?php echo $context["user"]["email"]; ?>"/> <input type="hidden" name="url" id="url" value="" size="40" tabindex="3" /></p> <?php } else { ?> <?php if ( $user_ID ) : ?> <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out ยป</a></p> <?php else : ?> <p>You don't need to give user information if you first login to the forum.<br /> <a href="<?php echo get_option('siteurl'); ?>/forum/index.php?action=login" title="Login to forum">Login to forum</a>.</p> <p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p> <p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p> <p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" /> <label for="url"><small>Website</small></label></p> <?php endif; ?> <?php } //...Get username + email from SMF ?> <!--<p><small><strong>XHTML:</strong> <?php printf(__('You can use these tags: %s'), allowed_tags()); ?></small></p>--> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php echo attribute_escape(__('Submit Comment')); ?>" /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> </p> <?php do_action('comment_form', $post->ID); ?> </form> Thanks, Ivan
  3. Hi, I searched everywhere to find working bridge between smf (1.1.10) and wordpress (2.8 ) and find plugin called wp_smf but is seems to be working only on older wordpress (with only one secret_auth...key). I have installed both plugins and in wordpress side it's working. When user register, he is also register @ smf, but password is incorrect cause smf addon uses only one secret key (thats from older version wp). Is there any known solution to integrate wordpress users database with smf and visa versa? In attachment is smf addon that uses only one "secret key" (instead of 3, as WP). I hope post is in right category. [attachment deleted by admin]
  4. Now I noticed that it was partially resolved...Only second refresh works, but first refresh (after vote) still updating queries...Not big deal but maybe it can be fixed ... It's strange, but now it working fine (i didnt touch anything). But on previous test update queries after first refresh...(thats why i never understand .php) I mark this "solved".
  5. I cant see error reporting, so i test it localy (wamp server). It seems that "]" is missing @ line 23. I fixed it and now testing online. EDIT:... Its working. Chris, I appreciate your help. Regards, Ivan
  6. It doesnt work. mysql_query() is updated with refresh page. I got blank page now... I already tried session_start() and some different code but i cant find right solution. Thanks for trying...
  7. I tried but it doesnt work. Also tried to read some tutorials, but w/o result. I need to start session with 2 IDs ($ID[0] and $ID[1]) where $ID[0] is first image, and $ID[1] is second image. When user refresh page, he cant vote again. Example: user vote (click) for image[1] than image[1] gain +1, and image[2] gain -1. When he refresh page image[1] again gain +1, and image[2] gain -1. So he can ifinity refresh page. It's really annoying. Please look at attached file (index.php, first post) and help me to implement session to prevent same vote when page is refreshed. Code where user vote begin @91 line. cbolson, your solution may work but I do not know if it is properly implemented. Thanks.
  8. cbolson, thanks for reply. ...yes that can be solution, but what happen when stored ID photo displayed again (images are displayed by random). Here is how it works: when user visit website (index.php) he can vote for one of two images. One image is "winner", second is "looser". When he vote for one image (example: index.php?vote=1,2) page reload with new vote and in left corner display result of previous vote. So sometimes it's possible to display same image from previous vote. Note: I am not familiar with .php, but know Java, html/css and editing some .php code (using php tutorial). This "photobattle" script is some open source example script which i have edited a lot.
  9. I have problem with code where users can rate random photos. But when user already rate photo he can refresh page and rate again for same photo twice. For example index.php shows 2 photos. User can rate one photo: Here is part of the code for vote: require_once('mysqlvalues.inc.php'); require_once('mysqlfunc.inc.php'); open_conn(); $res=mysql_query("SELECT ID, Name, Thumbnail, LinkText, LinkUrl FROM Models WHERE Status='1' ORDER BY RAND() LIMIT 2"); while($row=mysql_fetch_assoc($res)) { $ID[] = $row[iD]; $Thumbnail[] = $row[Thumbnail]; $Name[] = $row[Name]; if($row['LinkText'] != '' && $row['LinkUrl'] != '') {$Url[]="<br><br><a href=\"$row[LinkUrl]\">$row[LinkText]</a><br><br>";}else{$Url[]='';} } echo"<td valign=\"top\"> <a href=\"index.php?vote=$ID[0],$ID[1]\"><img src=\"images/uploads/$Thumbnail[0]\" alt=\"$Name[0]\" title=\"$Name[0]\" border=\"0\" width=\"320\" height=\"320\" /></a> <br /><strong>$Name[0]</strong> $Url[0] </td> <td align=\"center\"> <img src=\"images/vs.jpg\" alt=\"vs\" title=\"vs\"/> </td> <td valign=\"top\"> <a href=\"index.php?vote=$ID[1],$ID[0]\"><img src=\"images/uploads/$Thumbnail[1]\" alt=\"$Name[1]\" title=\"$Name[1]\" border=\"0\" width=\"320\" height=\"320\" /></a> <br /><strong>$Name[1]</strong> $Url[1] </td>"; close_conn(); ?> How can I prevent refresh page (or avoid somehow) so users cant vote infinity times one photo? Regards, Ivan [attachment deleted by admin]
  10. Greeting, I have a small script for a gaming site and need some help if possible. Script collect info from mysql database about players, killls, deaths and other stuff and all works. But I have some problems with sorting players list. I rewrited some code (mostly html and .css) and stuck with .php. I attached some files that need to be fixed. In "allusers.php" is list of all players with some stats. But it only works if I click on "Show all players"...I can not make to arrange players list by pages (it's original code but not working). Can this be fixed to show 50 (or 100 players) per page with page numbering (< 1 2 3 > )? Thats original code but it use wrapping to show players list and its very impractical and looking bad. This is link how it looks like: http://netsvet.com/dota/?p=allusers&s=name&o=asc&n=all where "n" is page number. If i set it to 1 or 2 its not working...only "all". Also, I want to show banned players (I attached bans.php) on players list. So this code need to be rewriten to check bans table and if it exists for that player name than display "banned" (or maybe use different collor background for that "block"; red instead yellow). Maybe this is not simple, and I try to do this manual but always failed. Thanks in advanced. Regards, Ivan [attachment deleted by admin]
  11. Maq and kickstart, thanks for fast feedback I'll try this.
  12. Hello, I am a beginner it is regarding PHP and I hope that someone can help me about these tidbits. I need a script that deletes the rows older than (for example) 3 months in the MySQL database. It is about the Joomla CMS. This is the script that I wrote: <?php include "connect.php"; $time = 'SELECT sysdate() FROM dual'; $stime = mysql_query($time, $con); $row = mysql_fetch_array($stime); print("Database current time: ". $row[0] ."\n"); $sql = "delete FROM jos_content where created < $time"; $del = mysql_query($sql, $con); print(" --> Deleted rows: ". $del[0] ."\n"); mysql_close($con); ?> So something is wrong (I know that is about date). I'd like to script using the server date (and <3 months) and than execute query, so that all rows older than 3 months will be deleted. Also I can use something like this: $sql = "delete FROM jos_content where created < '2009-03-03' "; but want to set a cronjob to do the work. Only problem is to set date (server date < 3 month). Also, I noticed that something is wrong with: print(" --> Deleted rows: ". $del[0] ."\n"); - it wont display the number of deleted rows. Suggestion? Thanks in advance.
×
×
  • 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.