Activity Stream
48,167 MEMBERS
61158 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member

    Default Code Rewrite

    Hello,
    I am trying to fix this mod so that it is compatible with smf 1.1.12
    http://custom.simplemachines.org/mod...x.php?mod=1138

    I am weak in database.
    i searched and found that $smcFunc doesnt work with smf 1.1.12

    Can you rewrite this function so that it works with smf 1.1.12 also ??

    Code: 
    function MetaTagsGenerateTeaser ($id_msg)
    {
    	global $smcFunc;
    
    	$request = $smcFunc['db_query']('', '
    		SELECT body
    		FROM {db_prefix}messages
    		WHERE id_msg = {int:id_msg}',
    		array(
    			'id_msg' => $id_msg
    		));
    
    	list ($teaser) = $smcFunc['db_fetch_row']($request);
    	$smcFunc['db_free_result']($request);
    anantgupta Reviewed by anantgupta on . Code Rewrite Hello, I am trying to fix this mod so that it is compatible with smf 1.1.12 http://custom.simplemachines.org/mods/index.php?mod=1138 I am weak in database. i searched and found that $smcFunc doesnt work with smf 1.1.12 Can you rewrite this function so that it works with smf 1.1.12 also ?? function MetaTagsGenerateTeaser ($id_msg) Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    http://www.simplemachines.org/commun...topic=224166.0
    http://dev.simplemachines.org/smcfunctions.php

    here is the example how it is used.

    Found this too

    $smcFunc['db_fetch_row'] is similar to http://in.php.net/mysql_fetch_row

    $smcFunc['db_free_result'] is similar to http://php.net/mysql_free_result

    Help me

  4.     
    #3
    Member
    Thought of editing the last reply but decided to make another reply
    Next try...
    Code: 
    function MetaTagsGenerateTeaser ($id_msg)
    {
    	
    	$request = db_query("SELECT body
    		FROM (smf_messages AS m)
    		WHERE m.id_msg = 1");
    
    	list ($teaser) = mysql_fetch_row($request);
    	mysql_free_result($request);
    
    	// Format as a plain text string.
    	$teaser = MetaTagsSpecialChars(str_replace('<br />', ' ', parse_bbc($teaser)));
    
    	// Less than the teasear limit, just return.
    	if(strlen($teaser) < 150)
    		return $teaser;
    
    	// Otherwise grab the teaser.
    	$teaser = substr($teaser, 0, 150);
    	return substr($teaser, 0, strrpos($teaser, ' '));
    }
    just need array to search for the current post's id_msg and place it here in place of 1.
    How to do it ?
    People on smf support also not replying damn...
    m.id_msg = 1

  5.     
    #4
    Member
    Problem solved...
    Can Do :-
    PSD TO ANY CMS | PHP(Dynamic Site) | MySql | Script Customization | cUrl Related Work
    Pm me for more info ;)

  6.     
    #5
    Member
    Yeah.... Thanx warezrock
    This mod will be out shortly for smf 1.1.12 by warezrock and me

  7.     
    #6
    Member
    do u guys have the version that's compatible with 1.1.12?

    click the banner!

  8.     
    #7
    Member
    Yeah was working on 1.1.12 only you need it ??

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mod Rewrite Friendly URL -need help
    By nk2join in forum vBulletin
    Replies: 3
    Last Post: 21st Aug 2012, 05:12 PM
  2. WCDDL v3 Rewrite
    By AmN in forum Web Development Area
    Replies: 3
    Last Post: 22nd May 2012, 01:19 AM
  3. [WCDDL] Mod Rewrite Help
    By DEViANCE in forum Web Application/Script Support
    Replies: 1
    Last Post: 28th Jun 2011, 04:28 PM
  4. wcddl v2 rewrite
    By r0ck in forum Web Application/Script Support
    Replies: 3
    Last Post: 4th Feb 2010, 02:30 AM
  5. .htaccess rewrite
    By Golden Falcon in forum IP.Board
    Replies: 0
    Last Post: 25th Jan 2010, 06:14 AM

Tags for this Thread

BE SOCIAL