|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
2 \4 h! e2 k$ z9 |* M. o// Theme Option" ^% U; p$ D7 v& F6 g& d
////////////////////////////////////////////////////////////////////////////////
" J' X. z9 p! L, |, U; l+ q% F$ b' E
$themename = "Zenx";5 g7 M+ p [6 ^3 n, y3 N" H
$shortname = str_replace(' ', '_', strtolower($themename));
" i1 w: w; C* F4 g _ F
- J1 e; |) s, g4 W8 Lfunction get_theme_option($option)
2 Q A0 W( v( D7 W7 c) v( k! m# t{6 G! p' Q$ W! t) x; g u
global $shortname;
0 |) v! j2 e" j" F! ]' f& z1 z9 y return stripslashes(get_option($shortname . '_' . $option));3 f; U& M+ Z9 b: o; L: Q8 m2 Z
}5 `/ p7 U- H6 a6 n% x
3 p- X% B3 r2 n- z1 x# `- L
function get_theme_settings($option)
* I! s" q) w& I; Q- @{
; G, q$ [1 ?1 k) ^; T+ V return stripslashes(get_option($option));
5 z0 k+ h) q. e# ^0 a, `}2 r- m# d6 e+ s4 L H/ y7 n
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
: i$ X3 b! \( t' `/ V$wp_getcat = array();
5 M* @) k: u1 ?foreach ($wp_dropdown_rd_admin as $category_list) {0 {9 R( i+ p) Q( P6 a7 o# Z+ ? b0 c3 b3 e
$wp_getcat[$category_list->term_id] = $category_list->name;
: ]+ n: D1 J- O d$ H4 W}
# z# r% o) n; E$ k+ \) l$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
+ p( V; b0 a& t& ?/ u8 ^9 N( d$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
: c4 v& }- r3 G- k/ _8 M$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
. @: {. p9 X9 k A0 g% @1 Q5 O: A& m3 ~0 M1 V3 j' L
$options = array (
& H' `& Z4 X8 J* A, A
' a' D; T3 E- b( Y& x
9 P9 c* i" q/ [* M/ ?) C4 o- J array( "name" => "Blog Header Settings",3 ~- q$ t# p$ W
"type" => "heading",2 \( f0 ~- @. [. I6 L5 h. }" v
),
; H% R( w! z$ `- L; o
# C/ p' A$ {# t" @6 ] array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% H+ f/ V: S9 ]% d* P2 m "id" => $shortname."_header_logo_activate",
C) s- ] m+ U: i' Z "type" => "select",- o6 d3 T, O' W8 @- I
"std" => "No", Y/ A- h X% C$ n$ ?, D4 y
"options" => array("No", "Yes")),
& f. X* M+ N) B, Z
5 a- c( J0 a4 d) w array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
: K3 Z" m) J+ O+ r7 d; K" T. G# `) \' t "id" => $shortname."_logo_url",: e, i, g' [! { b+ |2 Q
"type" => "text",7 M( D! C& z" A$ I% s' p
"box" => "social",1 r" R$ I/ M( _
"std" => "",' q: `3 @0 v9 s* @# n& Z( z) @# S
),* j( a; P/ [4 @- @: o, [9 } E
( k; j5 s& E, k* W
array( "name" => "Insert Header Banner HTML Code (Header)1 ~8 w0 l- i' _" f2 E3 ^4 ~
<br /><em>*Recommended Size 468 x 60</em>% d6 B% c% l3 Y. L+ ]8 k+ e
<br /><em>*leave blank if not use</em>",
" P* x6 `1 \3 C: R "id" => $shortname."_header_banner",5 V Z! M' ~% j5 `( j# w8 g
"type" => "textarea",
/ {" W* @( m5 K1 W "std" => "",
& g# t7 f7 K& y ),8 u9 h3 F6 Y5 p; v
2 r7 U. J. x# A/ P! v4 o9 V5 f* W array( "name" => "</div></div>",
+ v: D! Q7 L9 s2 O3 J "type" => "close",
/ n8 p: ]6 r9 r3 Y2 d! x2 G* S ),2 b, ]1 d: j$ @8 J# L3 c
7 {8 D3 ?4 E$ X2 P5 | |/ G. h- g4 Z' s1 U7 u) c
array( "name" => "Header Navigation Settings",
- @% i# U+ X z- W- Y% G "type" => "heading",- }# \2 M* H2 A% W) n$ g: i
),
. H) ~0 N) }% C9 L _! L
# u3 ^$ p1 }5 G0 N$ x array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
4 v' H! r( Q# m4 `. U( F0 o5 | <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />7 x) ~: U3 D; [2 D( A. M
<em>*Enter the page post ID number only</em><br />5 m5 x8 w G1 h1 \1 l
<em>*separate by comma</em><br />
: l; z- r1 n& Q/ C' c <em>*Exclude pages which you don't want to show on the header navigation</em>",
& R K. q: E2 j "id" => $shortname."_header_page_navigation",% V" W' ^+ L) Y/ x2 T4 ^
"type" => "text",1 q' K+ Q+ K$ P; B( N3 K% t
"std" => "",
4 S8 D2 e! ^" q ),
8 | u* t' P+ L5 ~2 G/ ^) l" L( j! n! A
array( "name" => "</div></div>",+ u8 h8 l+ p3 B: L
"type" => "close",: b& M+ k- J5 v9 k
),
- J% @4 V9 u( R+ y& e$ S
# o9 a, W3 I. c9 O! t6 d
5 R, U6 j) _& G6 C2 J G9 } array( "name" => "Post Auto Thumbnails Settings",) q" _% Q% c3 d# M
"type" => "heading",
( ~; v! e5 G% B3 W! R. _: Q ),
% G- Z) U9 H5 b# \7 H9 R4 c. d( i/ A " v1 r2 l0 t+ K9 n0 \
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 Z; ^5 F& a+ p% \$ o1 ~6 M "id" => $shortname."_timthumb_activate",
* V6 v7 B1 R5 p% @% r "type" => "select",* `5 \$ c2 X) D) r8 O
"std" => "No",4 F) G/ K) [; a( y% H
"options" => array("No", "Yes")),2 P; F$ G. V3 e0 E0 w* v/ }6 H
! Y. @% z5 t* Q# @: u$ \2 i
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
2 t5 X+ J0 `2 D- `4 z "id" => $shortname."_timthumb_cropping",
$ e. t6 s+ @6 _9 D "type" => "select",. {% I" ]# |3 H: t4 E
"std" => "",
/ ?5 X: C, B* R8 E# R+ j) C "options" => $crop_position),
3 m9 D4 n; u: Q( J* A
: W: ~# r/ {7 {; ^& H array( "name" => "Insert Width Of Thumbnail Image<br />5 F. b/ k6 U2 n! W: Q) A$ u
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
9 b# j2 z1 \ j& h <em>*Leave Blank To Use Default: 250</em><br />",
( Z/ P( `- M$ v "id" => $shortname."_thumb_width",
' Q/ h2 s% A- t# i5 |' Y7 F "type" => "text",( {9 I% t4 F {" n7 y0 U
"std" => "",$ _9 F& X( V' `1 ~
),% r# d+ r; I" U i! \
4 L3 i1 r# L/ Y* \ \+ a array( "name" => "Insert Height Of Thumbnail Image<br />0 ~( W" h1 C" ?
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
5 P' e, D1 B6 A. o6 F! M <em>*Leave Blank To Use Default: 200</em><br />",
" ]8 C% Q, _ y "id" => $shortname."_thumb_height",' m0 a# v( _0 c, F
"type" => "text",5 o" T" u5 z! {, V* P
"std" => "",8 J9 D' P4 `. F8 o1 X, W4 [
),
7 P) G, W H) j- i$ y" i1 R& r2 R& O1 u5 I& `) J2 f
array( "name" => "</div></div>",
$ G+ y8 k- a; _) `9 ~0 ^ W7 w "type" => "close",! i% p. k; s9 _+ A8 W, \
),
+ A4 Y) W. R( y2 x6 c: s, N4 n: g) p" s, @1 `
array( "name" => "Featured Content Slider Settings",+ X* G- o0 ~2 m( @$ K, N7 G2 n
"type" => "heading",
3 ?% L* f1 ~7 C' W0 z* ~ ),; Y+ ~" a/ a4 c6 U3 `: u% `& ]
% @: }$ e, e& p+ N+ r, w$ O array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) B/ x. G! }5 A2 s# K* `/ v "id" => $shortname."_featured_activate",( ?8 X' f2 B! u+ k% Q
"type" => "select",2 L/ b4 Y4 { M7 `
"std" => "No",% g4 U$ s1 v3 \4 ?/ q
"options" => array("No", "Yes")),
6 m( B$ X! b; Y) Y/ w) H8 ~7 E, T3 U: E
9 Q' f/ @/ z3 G5 _! x+ s array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",' d% e2 c0 }' M
"id" => $shortname."_featured_category",* e9 R0 A. W- R+ `
"type" => "select",9 \( k" R0 p! Y% W
"std" => "Choose a category:",
+ y: c: o7 m$ j8 q. K "options" => $wp_getcat),# j9 F2 d9 X8 `5 ?
! ~8 W% f F* @" } array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
; R. d" V5 Z: a; }4 n "id" => $shortname."_featured_number",
3 S( u: r; \( t( `8 o6 [ "type" => "select",7 ^0 X* C2 w; K
"std" => "Number of post:",
& }9 k U C: {; \$ \0 B: x/ I "options" => $number_entries),3 G. y' P, a$ m! q
6 s/ U2 `8 ~! r% l6 Z4 _ e+ m
array( "name" => "</div></div>",9 W% [& D- I+ a8 T
"type" => "close",& L7 h+ C' v' L1 _
),
! ~# _' c' d$ h8 z6 o. s3 ]9 l$ g" I / D# x/ y' E L3 R( C7 v
array( "name" => "Featured Category Settings",
5 \# M5 @( k4 L0 h "type" => "heading",
* s( G, D/ j2 C7 _1 A3 G' B ),1 M4 O6 u) i% T- B
4 z6 g F: v, }, J! Z+ P; z- ~$ A0 m array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 Z) t9 ^' d0 P7 `% X3 | "id" => $shortname."_featured_category_activate",1 i3 y8 m" g+ n5 x* \. C' c2 H
"type" => "select",
7 `# l8 C6 y1 N$ X7 |1 w2 E "std" => "No",
+ U% e: E$ s* @9 w3 z; ~ "options" => array("No", "Yes")),, F; W! B8 M% D4 ~
. g% q' w% N/ F L) B" @6 s* q
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",9 b# S7 I" G7 n1 U
"id" => $shortname."_featured_category_id1",! o/ o# p. t2 }9 b) ^) |: o6 w; O, t
"type" => "select",
2 }/ X) O5 H6 g/ O# D/ `7 e& L6 } "std" => "Choose a category:",
+ Y0 z. e) v I5 x- L "options" => $wp_getcat),: I- M' O) e+ S' o' G' \' Z
" K3 b+ i1 V/ Y8 D' t
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
7 L' Y8 S3 M$ Y/ b8 V. Q2 S "id" => $shortname."_featured_number1",
& \, v" M$ A" W5 l7 r8 D "type" => "select",
- ?8 ~! K2 _( G9 w "std" => "Number of post:",- i4 Q3 {- A" p) l+ s6 e
"options" => $number_entries),% P+ a! a) Q' K" G' P
8 G7 O- V1 r/ L array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
8 l- i" }+ X1 f' C3 F8 W9 U! N "id" => $shortname."_featured_category_id2",
6 c) b' N6 T& w. b+ ^ "type" => "select",
9 f& c* P9 t9 F8 G, D- M "std" => "Choose a category:",+ t2 f8 h# D2 z8 |) d# t
"options" => $wp_getcat),
2 ~3 b8 e! y' C! f3 Z9 r7 M- ~* z
; T& R% V8 ]5 o# N. `* F+ u8 \ array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
8 H: f0 `; @* }6 Y. X9 o1 \ "id" => $shortname."_featured_number2",8 o% G5 u& p% e4 Y, a' c
"type" => "select",2 N! O8 R. z6 \) d. `( Q; y$ U/ s
"std" => "Number of post:",8 U7 b+ p" q/ U* Z* ~/ N3 q
"options" => $number_entries),- A, w# `1 P8 M+ j# ?
$ b2 K: l9 b/ x- S% I& a 5 V: C9 K$ K9 h$ v: b7 T e
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>"," ^; |% v7 p( }" J. y$ X# `
"id" => $shortname."_featured_category_id3",
0 o. T A, C! u3 p7 D "type" => "select",
k* H* J2 k5 [* @$ q4 [: ]8 Q "std" => "Choose a category:",' W# `/ r s# ^) T! s
"options" => $wp_getcat),
3 \! D1 c3 k: i0 U) r- @ 1 M4 G. t4 Z e1 h7 j
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
* I( R; X O0 Y9 B, w "id" => $shortname."_featured_number3",
8 q* h& q" {# j0 g "type" => "select",
( Z& x% m9 V6 Y9 A3 A "std" => "Number of post:",7 x$ H) E$ Q4 G D; X! q
"options" => $number_entries),. W" ?3 f. p# u. O; h
( O0 O8 ]0 K8 x$ P6 O& F/ ~# |0 r
! P8 }" p/ Q# K3 X& \0 N array( "name" => "</div></div>",- o! s2 a% E+ _/ D$ v' {& X0 X, E
"type" => "close",
* @0 ?% [# [/ m) V# H ),
. G- W# A6 r; y1 N4 c4 v( u& A
; n2 w {- d5 J7 w- z* p+ }4 f# O+ V# w% V. Z0 D) Q+ J4 W
array( "name" => "Google Adsense & Analytics Settings",
) e- c* p: {; x+ ` "type" => "heading",
6 e8 f! [4 z7 j6 T ),3 x) S# A1 P" l6 x6 v( a2 j% V7 H7 o
3 T! D$ j$ |" h3 I! k array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
" m, p( P& K3 d "id" => $shortname."_adsense_loop_activate",
& L e e! R- e5 q2 G) l1 L0 j "type" => "select",# m/ W* J) W# G, u
"std" => "Disable",' v( O* t( l' n% b' i S/ S/ @
"options" => array("Disable", "Enable")),
8 q7 ]% A. Y, Q: |, J2 o: [6 k3 }9 j2 O+ E$ Z9 Q
array( "name" => "Insert Google Adsense Code For Loops Here<br />" }. \' ]$ U4 |! Y* H7 S. _
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",. e( d( D F* Z/ V! c
"id" => $shortname."_adsense_loop",
( n5 r3 |+ C( o$ O3 ~ "type" => "textarea",# e. a. [5 ^: r
"std" => "",( R9 {: z; q* d9 A( e( e
),
$ Z1 B* m' }- ?5 T
6 j0 l5 E5 h- i2 } array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",, \" ?4 e$ z4 f3 R
"id" => $shortname."_adsense_single_activate",
% B% ^( M; ]5 I9 d1 w- V* k7 J( P' F "type" => "select",2 R! `1 Z% }4 }5 x/ B* F* J* ? o
"std" => "Disable",' X# W h) I+ g U* U# n( O
"options" => array("Disable", "Enable")),4 Y" G8 @8 n- H3 a; f
6 R9 w6 u2 |6 l# `2 J; ?( L
array( "name" => "Insert Google Adsense Code For Single Page Here<br />8 I" B, p; ^/ E& K m3 h; t
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",, o* ~3 l* |2 ]1 b6 s. j
"id" => $shortname."_adsense_single",
8 _- }1 r8 A* J- Z6 [ "type" => "textarea",
6 Q; ?! u4 z2 A& w6 A h0 S2 s "std" => "",( a0 ]9 l5 ^& Q# k) H1 L) [5 P
),
3 i+ Q# f1 x# ~- m" j. x! B3 U
6 _+ `# U- {' Y& I3 s! {$ R
. B1 W/ f* p- z7 M" V9 x# D. e array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",: |, c7 K" S0 l4 N' F3 y, c1 J
"id" => $shortname."_google_analytics",
; b I$ a2 \& S6 w) x$ e+ N$ [ "type" => "textarea",: k$ b$ [/ ~& g8 [1 |
"std" => "",
: @7 ^ `- p" q) B2 K5 B4 w ),1 Z0 l: {/ w& [8 L
8 D3 b) W" S: I& T
array( "name" => "</div></div>",( ~- V6 r8 [! i1 L _
"type" => "close",
3 e5 X, p4 I- a7 o4 z ),9 `+ C* n4 ~9 ~0 |6 f
" X0 [2 M8 ^( h) W/ P: t
2 q4 B8 V6 x" a: n4 M4 q array( "name" => "AddThis Social Bookmarking Settings",8 r3 e% l% n+ i3 L0 ~, ]4 C1 [
"type" => "heading",2 S. g2 x4 Y3 d* B3 p/ h- c5 B1 z
),
6 i$ D" i' _$ c4 [8 _ K, ?! R
6 E' K: v. I$ Q+ c8 O: F array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
& Z. M+ k/ j$ Q* ]7 g- Q0 t3 j <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
& w% U8 _! Q! y+ V! ^$ z4 D4 g1 z/ ^ "id" => $shortname."_addthis",/ s. U1 z) a; G7 k
"type" => "text",
6 y4 o: n s8 y) ?. e "box" => "social",6 `" U7 j; ?$ E4 @& D
"std" => "",* A |+ l5 P) R. ^2 F
),
4 B# {' H4 F7 D; d7 F% A: @- I9 d9 b$ r+ @ z* O% n$ j) V
array( "name" => "</div></div>",
0 L* D9 l' b9 h6 `/ x# H5 V- g7 C "type" => "close",
9 p3 @7 |3 V, j! F3 ^1 L+ ] ),, m+ g; c- e2 S1 u) m5 E
6 m8 g4 E5 c W; X' H
/ q7 D1 S& y& y. `/ Z4 U& V
& t( O8 O. q5 S+ }9 A9 p: j1 C array( "name" => "YouTube Video Settings",, r* v: L% j, I3 J9 @) c
"type" => "heading",6 ~3 `, }) A4 E8 p9 d: ~
),
, u; {( m0 y8 @" ?# v5 ?; s. B
, ]' F. g3 ~' u2 {) r% ~5 _% T array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- q" O' X4 N; a/ ?1 }# F3 ~ "id" => $shortname."_emvideo_activate",) h9 n: J, q" r, x
"type" => "select",$ b+ `# @3 L5 ^2 `2 |0 m2 k
"std" => "No",
7 |- K5 Z" O0 A1 T* _ "options" => array("No", "Yes")),' k, x3 h& Y7 D' ?' ^
& p' y7 ^, r$ ~1 `
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",% j7 {* x. ~9 [# l1 M' H" I
"id" => $shortname."_emvideo",
; ?: Y( g+ g3 c* h "std" => "",; `5 }2 m5 B# s- z" o# V& ^
"type" => "text"),1 Z" Y& Q( P* J3 N- i3 k
+ B0 y9 ]9 |" Z) w- ~2 g
array( "name" => "</div></div>",
2 t, i- D/ U. x' u "type" => "close",
$ ?/ ^0 w. F* S* [2 b, [9 n4 l5 s ),/ c( z- Y. n2 A7 X( o, j
; @$ t! P' `* M1 i P
array( "name" => "Twitter Settings",. t2 g! q9 c: ]( Z" S% z _
"type" => "heading",
6 R1 E Y1 M: H8 B ),
3 `1 V3 @: ?! V: y% L+ j9 E3 ^8 g5 P- f7 p& Y9 N. d% q
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. u0 ^) r9 X! @3 v' l* t
"id" => $shortname."_twitter_activate",' ]( @0 d( D7 H* {5 j
"type" => "select",+ b3 f( }% B/ e
"std" => "No", \5 ]+ G& [% n# Y m0 d. r
"options" => array("No", "Yes")),; j7 q- k2 @ {8 n0 K) K
# ]; L/ w' Z$ r) \3 O { array( "name" => "Insert Your Twitter ID here, y( z# w p9 g/ \: Q
<br /><em>*leave blank if not necessary</em>- ^7 j2 O8 U1 c0 o
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
2 \- @* x9 A' G4 L: R8 t "id" => $shortname."_twitter",
3 N$ g+ Z% K: s6 ]- a" M "type" => "text",2 q& E0 P# L% ~3 }+ k! o6 X; r
"box" => "social",
) p5 W ~, t% Z4 r "std" => "",
9 h- ~" p: i4 A$ l) Q, O% [6 D& a ),
, G+ k/ U) D% |6 {/ s7 E; k# V
array( "name" => "Enter Twitter Feed Count here+ G4 _: N# N4 D, x! o2 _
<br /><em>*leave blank if not necessary</em>
4 M& {6 M- y' E/ W1 z) _ <br /><em>*Enter How Many Twitter Feed To Display</em>",+ u2 l0 l W5 \# p
"id" => $shortname."_twitter_count",
( @. ^( H8 _, J: H "type" => "text",
+ c& U, H ]( n8 u "box" => "social",
9 }7 t* T6 c6 D+ b* [; J- k; ~# r "std" => "",
" k/ ~+ j+ a* j' }+ E/ @ ),
$ J* G% w- A" N$ u1 ?5 A* | ^8 {; z* O2 V
array( "name" => "</div></div>",
/ R1 y; m) X; |9 F! p3 H "type" => "close",
3 b* N) ]/ l, O. I/ I ),
; |4 G. m# B( ^& [$ J- Q `
% G) T% D5 ^# l: S, \% j1 f0 Z: t0 u% [$ o! p, D
array( "name" => "125 x 125 Banners Advertisement Settings",
( j; e& ~2 P( n3 T( c$ D* n3 }+ { "type" => "heading",
4 K4 z: [4 e+ y2 k; f; }. l ),* U8 F5 U* m# R/ A& j/ o
$ F, G$ d$ y5 W2 L array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 e6 M0 Z, D) W% J' q# L) r "id" => $shortname."_sponsor_activate",
- _8 }4 a, n% x5 P( E "type" => "select",
E3 o" H4 ?5 T( S% `! A$ f "std" => "No",& u3 v8 K& J6 o8 ~+ ]" q- [) G+ V
"options" => array("No", "Yes")),/ @( R* e+ Q9 x+ x
4 B, @2 X2 \& X9 d _9 w' ?; `. Q3 k$ L/ y3 O+ S8 S
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",$ u; O O+ J% f6 y& ^/ p
"id" => $shortname."_sponsor_banner_one",
' K( z5 w$ X7 t6 g* d# K "type" => "textarea",
' @8 A2 T) k# g8 T. _' s "std" => "",7 x- l+ H9 i9 o
),
3 G% i1 L, B9 J5 Q" _* n& k1 w; D. ^& I9 ~9 B4 Y/ K6 m7 v
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",5 S& F$ Q7 R l% f
"id" => $shortname."_sponsor_banner_two",: w; y1 \: e7 o+ f3 [0 Y$ f
"type" => "textarea",8 Y& Y/ N; \) O p. q
"std" => "",0 F' x# n6 H. ?
),
7 N8 X% v- T3 |' M9 P( |" t4 ^" y8 c5 L$ G& t5 O
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",8 m* y- Q: H$ f2 J, X! f) x
"id" => $shortname."_sponsor_banner_three",# C$ v+ s/ j' ^
"type" => "textarea",3 r' x/ @0 Z# H8 k- F1 W
"std" => "",# K ]% p0 X F4 {3 `6 H, R4 V) F# w
),
% Q3 _+ [! F; R& M# G4 s
; }9 b- ]% d9 m+ b8 J5 w- d$ J array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",& c* M% O+ X2 ~6 n5 m: l. [
"id" => $shortname."_sponsor_banner_four",( [* p0 W. }2 N) `7 Y
"type" => "textarea",) g* O/ { D" H# \2 u" w1 Q. `' V
"std" => "",
; C/ }; A: O) @4 w! x0 C ),
, K5 \) ]2 ~) }- a' O* A1 }! i- }8 Z' J( m
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",7 a( Q# N8 b7 r7 `
"id" => $shortname."_sponsor_banner_five",7 ~ `* I7 }# h) R
"type" => "textarea",
' i9 I! @5 u7 Y2 f6 O @ "std" => "",$ A" a: C4 ] E5 \; Q7 `* E# ?7 n" C% S
),
2 V2 I+ l+ O, q0 T$ X4 C" s& R2 H2 J+ Y- e0 v
( _% T( \4 Q: p' q/ d" X5 \2 z array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
- R' A0 x% `) M/ B* | "id" => $shortname."_sponsor_banner_six",
, z) y3 c( K5 V @ "type" => "textarea",
+ K7 Z0 n# W. D$ r "std" => "",. K! C, H3 y& ~3 {' H
),
: ?4 s8 x- V: e' u, U/ A7 o, k- T0 H9 K' C
array( "name" => "</div></div>",0 k; @+ b% k: [/ _- e$ O7 W
"type" => "close",
& J. m- u6 f2 B0 V ),
& W% k b0 }/ E
' @7 V5 M/ B( ?7 P" F- j9 E# }
7 ^8 u) l7 z9 G5 ?/ B7 b: G4 }3 C% g2 E. x* M% d2 v
);
7 }; B+ [! ]! n6 l& j0 i
- E) E6 p0 P: y$ Sfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {. I- w: l7 R3 W: j- s2 u2 B
* O3 [# C4 t. M8 c( V3 e: ^echo "<div id=\"admin-options\"> ";
$ x3 o6 p& h7 x4 P) t( f
$ n! e! M/ b7 M1 L3 p0 X0 [global $themename, $shortname, $options;& H7 G4 C" z& C8 T( h$ |6 D/ [1 F
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
% {' G% D& B F1 Gif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';, G, s; ~2 ]8 b: j4 t
?>
) y H& l7 {5 B9 u8 Z2 |% ]: v. i& Y8 x4 [2 H: ?4 o
<h4><?php echo "$themename"; ?> Theme Options</h4>7 k% }/ p3 t( Z ?" M
9 M6 g1 v5 W9 q
<div class="annouce">
' z0 O6 I9 _! s' H1 G1 O* R<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1> W2 B2 m; _4 W# y3 Q
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>5 O- M, d x+ G! A! P/ ~
</div>) W8 O8 S$ P! P
: ~2 @6 _6 q! t( Q, I
<form action="" method="post">
1 b* |* P8 t" b# R0 k6 |% m; v2 G& I# D9 B
<?php foreach ($options as $value) { ?>
$ f4 a( ~, d, U1 _& f
: p$ d E3 u) U/ `; g/ u, p, O3 q<?php switch ( $value['type'] ) { case 'heading': ?>4 } s Q: G9 g4 n
3 q/ w1 }' p4 z: O<div class="get-option">: I7 o* M# ]/ S7 P6 y' K# y
: [: h( T& h! n+ c, P" t<h2><?php echo $value['name']; ?></h2>
4 ~) X ^9 |% ] G; J9 X
" C/ J. t! S1 Z/ d& r: Z9 a/ B# j, w6 z<div class="option-save">
6 `; e' e, I4 q3 u% x6 v8 S8 i3 u4 L M( D
<?php
2 K$ p# r) o) z" T. \break;
$ ^: l$ h! F' ^3 z7 f3 A- |case 'text':# P% V. x; p$ h" P, g: B$ X p4 Y
?>
3 ]+ u( ^% h) u1 T, w
9 F$ e9 p3 r2 \- I. ~. l<div class="description"><?php echo $value['name']; ?></div>
! o1 m) u @' m: l<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
/ I# [2 e' t0 ]/ P( _( @* w: ?$ ] V+ L) i
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>3 v- j. o. P' Y5 ?8 K7 F" K
, ^4 U& L% h& r- E9 A! s& i
<?php3 I1 E$ M1 E) ?- T8 O: Y- n% U* J
break;
1 O: T) ?1 h# xcase 'select':% }) e0 s7 a2 Y6 [3 G; b; Y
?>7 [& c8 f; B! v6 L/ M4 _
& v1 s) v3 }: _& }/ m% Z
<div class="description"><?php echo $value['name']; ?></div>
( s, ~. U/ O; o/ Y5 ?- ]<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
, U+ j9 Q8 d) Z& v* B: ^<?php foreach ($value['options'] as $option) { ?>, M F5 }3 R1 L; w$ x8 m
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>9 G6 _' _1 h D) r0 H
<?php } ?>, f5 p2 E6 w- ]
</select>
2 I. h/ J) Z2 h8 Z$ h</p>1 G+ ]" t8 G% T
, Q9 Q1 R7 E& U0 s; N' B6 l<?php/ ~, Z5 a; z6 y2 ~
break;
+ D" }8 a3 |4 f# s9 i4 Ccase 'textarea': Y, V4 m' B/ {9 k
$valuex = $value['id'];6 G P4 f5 r! l1 U$ h7 e. @/ ~
$valuey = stripslashes($valuex);0 G+ U- D- T! J9 O `
$video_code = get_settings($valuey);
; S& \9 A7 H! t T6 o( ? s5 z?>
+ ~# G; I. D; g6 j
; r, h u8 W7 }( P [$ n/ v<div class="description"><?php echo $value['name']; ?></div>
" V4 S$ N, J. s2 [$ N<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }: M% Q; P$ B- O# H1 c x# O
/ a E4 x' D8 O# F/ qelse { echo $value['std']; } ?></textarea></p># d P( p7 ~& L4 ?. c
" ~; v' M+ e' X( ^! i" F<?php
5 H, g, B/ M Lbreak;: @/ E, ] \4 O
case 'close':+ ]) D' r; _1 G) Y5 d" `3 @
?>$ c% {) C, [$ p- z j, ?% Q
9 G" J; ]- o( ~1 c. B& F<div class="clearfix"></div>2 @' p6 R2 Y. }
</div><!-- OPTION SAVE END -->+ l3 [9 K: S) G4 E
9 y1 ?' D* ?, b. U0 ]/ D<div class="clearfix"></div>. U( J! o( ~9 K, ^8 m' N
</div><!-- GET OPTION END -->7 d$ p: e, x% o# n
: e3 ^1 e- P6 L1 ~" _7 ~9 D% @% {( g<?php8 ^' A& h' @9 G, S
break;4 K1 S$ ~2 r/ y" g5 b
default;
2 V- v5 W. p0 D?>. W6 h, S7 |5 m& n1 F; C
) z0 h4 i# {# T+ u# y( c" k
3 Z, @, R1 x2 g
<?php, e4 ?. ?+ ?, \. n5 J# n4 t
break; } ?>9 o8 [ E$ R) j# S
3 D/ f1 y9 U2 \8 ]$ H<?php } ?>
" V2 U- O; e# X- o8 L& \9 a ^& N/ M* O' N. ]' T
<p class="save-p">0 ]/ W2 C. I+ o. s5 m
<input name="save" type="submit" class="sbutton" value="Save Options" />2 C3 B; c. D2 k! j+ D
<input type="hidden" name="action" value="save" />
" {- N* R: v2 c9 D, v+ V6 W</p>0 [; F) D. z) H2 ~+ J7 J
</form>
2 C2 q7 Q" B6 D% ] M; O: ~! n! |: u, W/ [' n& V
<form method="post">
2 b1 u( G+ `9 b! C& h- e& i- j<p class="save-p">! J& p$ c6 D$ F9 L0 Z3 T
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
. k) A" C* p) W5 J<input type="hidden" name="action" value="reset" />
( D2 f0 v7 L: W2 n4 G2 h/ ^" I</p>
6 [3 r7 U- F/ V</form>
4 a! L+ `) H' X6 P$ \5 |! h. r2 |9 {# o
</div><!-- ADMIN OPTIONS END -->+ L$ ^" Q: P% d$ Y1 E3 A, ^( a
2 a9 ]1 e ^, C, F* t+ G$ P8 |& t4 w
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }$ k' q" z1 H" u' W4 ~/ [
: Y- g ~8 {1 `, lfunction mytheme_admin_register() {
- n+ p/ C. W1 w' o' a; n* ~global $themename, $shortname, $options;/ Z. p% G' X3 n
if ( $_GET['page'] == basename(__FILE__) ) {
- H+ w H; Q# o3 w7 O" g" Fif ( 'save' == $_REQUEST['action'] ) {4 l4 }8 h# H m" j, _3 z
foreach ($options as $value) {
F' c$ O5 ^% Lupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }: H- d/ n9 C$ y% f4 u; {
foreach ($options as $value) {
" Z7 G$ E+ t. s7 I4 A5 }- P- |9 wif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
. u# `& N4 d m' x9 G; Iheader("Location: themes.php?page=functions.php&saved=true");0 h5 b9 N- j$ u* E
die;
9 _6 n0 _0 b3 D2 T* G. _6 B} else if( 'reset' == $_REQUEST['action'] ) {
$ l0 X1 g& V0 h% q( j& H( J7 bforeach ($options as $value) {3 e% h3 U) C3 w8 o' v" u$ |
delete_option( $value['id'] ); }
( X" U1 ?7 U- A s v, m; j4 |4 i1 kheader("Location: themes.php?page=functions.php&reset=true");
* E0 M, R' \0 d7 w; adie;
' B( ]2 t2 B+ ~( q8 N}
- D8 e$ a8 \' p- x}. |. z: Q! T; F/ V, h9 m
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
0 r( g4 F6 F* q3 m5 y w}
3 P& v2 ^3 X1 C G, r( ~3 p8 {
; i- o' ^1 y: j U9 ?function mytheme_admin_head() { ?>
5 e) v/ x" h# b8 i<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" /> c+ F% f+ L" x+ R- o, g
<?php }
5 @8 Z' l ~; p k |
|