Jump to content

carnold

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

carnold's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello all! I am trying to code something on my blog, a friends-list. I have the function and have inserted the following code where i want the friends-list to appear: <h2><?php _e('My Friends'); ?></h2> <?php if(function_exists('list_friends') { list_friends($FriendsOfUser, $tagBeginWrap, $tagEndWrap, $bLinkToBlog = True, $ShowPic = true, $pmLink = false, $lilist = false, $picsize = '16', $showname = true) }?> but this gives me a white screen. The error in my apache log is this: PHP Parse error: syntax error, unexpected T_FUNCTION in /srv/www/htdocs/sites/MTwG/wp-content/themes/LivingOS_DELTA/sidebar1.php on line 104 and this: PHP Parse error: syntax error, unexpected '{' in /srv/www/htdocs/sites/MTwG/wp-content/themes/LivingOS_DELTA/sidebar1.php on line 105 From the research i have done, this appears to be a syntax error, a semicolon on bracket not closed. I have tried a number of different combo's and still can not get this to work. Can someone help me with this?
  2. Sorry if i post this in the wrong forum. someone plaese move if in fact it is posted in the wrong forum. What i am trying to do is have users of my blog (run with mu wordpress which is essentially the same as wp) login on the main blog, http://mytimewithgod.net, and then be redirected to their blog. Here is some code from wp-login.php: if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() ) $redirect_to = 'http://'.$user_login.'mysite.com'; else $redirect_to = $_REQUEST['redirect_to']; if ( $_POST ) { $user_login = $_POST['log']; $user_login = sanitize_user( $user_login ); $user_pass = $_POST['pwd']; $rememberme = $_POST['rememberme']; } else { $cookie_login = wp_get_cookie_login(); if ( ! empty($cookie_login) ) { $using_cookie = true; $user_login = $cookie_login['login']; $user_pass = $cookie_login['password']; } } Can someone help shed some light on this?
  3. Hello all! I use multi-user wordpress for blogging software. I am trying to redirect users to their blog after a successful login. The code i am using is: if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() ) $redirect_to = 'http://'.$user_login.'mysite.net'; else $redirect_to = $_REQUEST['redirect_to']; if ( $_POST ) { $user_login = $_POST['log']; $user_login = sanitize_user( $user_login ); $user_pass = $_POST['pwd']; $rememberme = $_POST['rememberme']; } else { $cookie_login = wp_get_cookie_login(); if ( ! empty($cookie_login) ) { $using_cookie = true; $user_login = $cookie_login['login']; $user_pass = $cookie_login['password']; } } Notice the part in bold? This redirects to the main blog page. Is there anyone out there that uses WP that can help? Or anyone that can help?
  4. Hello all! I use wordpress for blogging and on this site i am trying to display users gravatars on the site. If users have not set a gravatar, then i would like it to show the "default" image it shows now. I am also looking to display the users name, nickname and a edit my profile link for the logged in users. Here is the code i have now but it will always show my gravatar: <h2><?php _e('Your Gravatar'); ?></h2> <?php global $userdata; get_currentuserinfo(); echo($userdata->first_name); echo " "; echo($userdata->last_name); ?> <?php global $user_email; get_currentuserinfo(); echo "<img src='"; echo gravatar($user_email); echo "' alt='' class='gravatar' width='60' height='60' ALIGN=LEFT />"; ?> Nickname: <?php global $userdata; get_currentuserinfo(); echo($userdata->user_login); ?> <?php global $user_email; Ooppss, here is a link to my site: http://www.mytimewithgod.net and on the left side of the page you will see "your gravatar". Thanks for any help
  5. Yea, i copied that from my posts on the wordpress forum. Their forum will try and run php, so you have to fool it with spaces. Sorry about that. It is without spaces in my php file
  6. OK, i am trying to integrate a vanilla forum into my existing website theme (i use wordpress). So, i open the vanilla head.php file and try to insert < ? php require('../wp-blog-header.php'); ? > inbetween the < head > tags. When i do, i get this error: Parse error: parse error in /srv/www/htdocs/forum/themes/head.php on line 12 When i change < ? php require('../wp-blog-header.php'); ? > to require('../wp-blog-header.php'); i get this error: Fatal error: Call to a member function on a non-object in /srv/www/htdocs/wp-includes/cache.php on line 206 Example of what i am trying to achieve: www.mytimewithgod.net/xdforum. This has the forum in the "content" area with a right and left sidebar and header and footer. This is exactly how i want the new vanilla forum to look (in the "content" area with sidebars and header and footer). Example of the vanilla forum now, www.mytimewithgod.net/forum. By putting in require('../wp-blog-header.php'); in the vanilla head.php file, you tell vanilla about wordpress functions and what-not. Can any PHP guru help? Thanks in advance
  7. [!--quoteo(post=361727:date=Apr 4 2006, 04:45 PM:name=DrDre)--][div class=\'quotetop\']QUOTE(DrDre @ Apr 4 2006, 04:45 PM) [snapback]361727[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hmm you got some tmp file or something in there that it cant access. [code] if (is_dir($dir)) {    if ($dh = @opendir($dir)) {        while (($file = @readdir($dh)) !== false) {                //FRMB01C007.htm             if(substr($file,0,4) == 'FRMB' && substr($file,strlen($file)-4,4) == '.htm'){                 $book=intval(substr($file,4,2));                 $ch = intval(substr($file,7,3));                 $data = @file_get_contents($dir.'/'.$file);                 if($data && strstr(strtolower($data),strtolower($_POST['indata']))){                                          $results[$id]= $id.". <a href='".$dir.'/'.$file."'>Book: ".$books[$book]." - Chapter: ".$ch."</a><br>";                     $id++;                 }             }        }        @closedir($dh);    } } echo "<h3>".($id-1)." Result".(($id-1) == 1 ? '' : 's')." Found.</h3><br>\n"; echo join("\n",$results); ?>[/code] That should fix all the problems. Then customize it as you see fit to make it look better :) [/quote] Sorry for the delay (my mom was in a car accident). Yea, so i changed some permissions and it worked without the last bit of code. Thank you so much for the help! Trying to "style" it now to look like my site :)
  8. [!--quoteo(post=361712:date=Apr 4 2006, 04:24 PM:name=DrDre)--][div class=\'quotetop\']QUOTE(DrDre @ Apr 4 2006, 04:24 PM) [snapback]361712[/snapback][/div][div class=\'quotemain\'][!--quotec--] Ok so I was bored (even tho i got tons of work, guess you can consider it generous? :P) And basically coded the entire thing for you. [code]<?php $dir = "../kjvdict"; $books = Array(     1  => 'Genesis',     2  => 'Exodus',     3  => 'Leviticus',     4  => 'Numbers',     5  => 'Deuteronomy',     6  => 'Joshua',     7  => 'Judges',     8  => 'Ruth',     9  => '1st Samuel',     10  => '2nd Samuel',     11 => '1st Kings',     12 => '2nd Kings',     13 => '1st Chronicles',     14 => '2nd Chronicles',     15 => 'Ezra',     16 => 'Nehemiah',     17 => 'Esther',     18 => 'Job',     19 => 'Psalms',     20 => 'Proverbs',     21 => 'Ecclesiastes',     22 => 'Song of Solomon',     23 => 'Isaiah',     24 => 'Jeremiah',     25 => 'Lamentations',     26 => 'Ezekiel',     27 => 'Daniel',     28 => 'Hosea',     29 => 'Joel',     30 => 'Amos',     31 => 'Obadiah',     32 => 'Jonah',     33 => 'Micah',     34 => 'Nahum',     35 => 'Habakkuk',     36 => 'Zephaniah',     37 => 'Haggai',     38 => 'Zechariah',     39 => 'Malachi',     40 => 'Matthew',     41 => 'Mark',     42 => 'Luke',     43 => 'John',     44 => 'Acts',     45 => 'Romans',     46 => '1st Corinthians',     47 => '2nd Corinthians',     48 => 'Galatians',     49 => 'Ephesians',     50 => 'Philippians',     51 => 'Colossians',     52 => '1st Thessalonians',     53 => '2nd Thessalonians',     54 => '1st Timothy',     55 => '2nd Timothy',     56 => 'Titus',     58 => 'Philemon',     57 => 'Hebrews',     59 => 'James',     60 => '1st Peter',     61 => '2nd Peter',     62 => '1st John',     63 => '2nd John',     64 => '3rd John',     65 => 'Jude',     66 => 'Revelation' ); $id=1; // Open a known directory, and proceed to read its contents if (is_dir($dir)) {    if ($dh = @opendir($dir)) {        while (($file = @readdir($dh)) !== false) {                //FRMB01C007.htm             if(substr($file,0,4) == 'FRMB'){                 $book=intval(substr($file,4,2));                 $ch = intval(substr($file,6,3));                 if(strstr(strtolower(file_get_contents($dir.'/'.$file)),strtolower($_POST['indata']))){                     $id++;                     $results[$id]= $id.". <a href='".$dir.'/'.$file."'>Book: ".$books[$book]." - Chapter: ".$ch."</a><br>";                 }             }        }        closedir($dh);    } } echo "<h3>".($id-1)." Result".(($id-1) == 1 ? '' : 's')." Found.</h3><br>\n"; echo join("\n",$results); ?>[/code] Set an array for each book (yeah i had to number each of those >.<) And read each file and if it finds the search term, print the book and chapter found in. Should be no errors.. Least zend reported none. unless i messed up on the substr's. hope it works. [/quote] Dude! You are the man!! I can now run searches, on the searches i have done so far, it returns results but has this error at the top of the page: Warning: file_get_contents(../kjvdict/FRMB01C010.htm~): failed to open stream: Permission denied in /srv/www/htdocs/wp-includes/search.php on line 83 70 Results Found. I have chmod file to owner full and other full permissions. I have looked at line 83 in search.php, lol, but it is foreign to me. Thanks again!!!
  9. [!--quoteo(post=361691:date=Apr 4 2006, 02:52 PM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Apr 4 2006, 02:52 PM) [snapback]361691[/snapback][/div][div class=\'quotemain\'][!--quotec--] Problem with that is you would have to search for text inside a file, on top of that they are html files so you would have strip all html tags out. Also I imagine there are multiple folders uder the folder they are in. if you can give your file structure it may help out Ray [/quote] No, they are under 1 folder. Structure: wwwroot/kjvdict/then all the htm files. What way would you reccomend to search?
  10. [!--quoteo(post=361679:date=Apr 4 2006, 02:36 PM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Apr 4 2006, 02:36 PM) [snapback]361679[/snapback][/div][div class=\'quotemain\'][!--quotec--] Looks like you are using some speedbible software. In order to do a search we need to knowwhat format the files are in. You said they are in their own directory but what kind of files are they. text, csv, ect. Ray [/quote] Oh sorry, yes speedbible from johnhurt.com. They are htm files. The links to the chapters do work, so if you click any chapter in any book, in your address bar it will display the full path including the file extension.
  11. [!--quoteo(post=361616:date=Apr 4 2006, 12:35 PM:name=Dan R.)--][div class=\'quotetop\']QUOTE(Dan R. @ Apr 4 2006, 12:35 PM) [snapback]361616[/snapback][/div][div class=\'quotemain\'][!--quotec--] How you search your bible greatly depends on how that bible is stored - is it in a database? Multiple html pages? Where did you get this bible and could you post a link? [/quote] Sure, the Bible is stored in its own directory and is multiple files. Link is www.mytimewithgod.net/126. Thanks for the help.
  12. Hello all! New to php and the groups here at phpfreaks. I have a web site that has a html Bible on it. I would like to know how to create a search form that will search all the books of that online Bible. For instance, you goto the website and type in "romans" and then click on "search". It then should return all referneces of the word "romans". I did look through the "scripts" section here but found dead links. Also did a "search" throught the forums but did not see what i needed. Let me know if anyone needs the site link. Thanks for any help. Chris
×
×
  • 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.