|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
2 D6 h. g* n* [5 |( K; w% x// Theme Option8 ^0 P* n5 D; b o" j
////////////////////////////////////////////////////////////////////////////////
7 D- v& T2 s8 v. b. L6 F
7 U. L( X0 m0 K; V& e2 o* \! A0 f7 A$themename = "Zenx";) ]+ a, c6 I0 m" A
$shortname = str_replace(' ', '_', strtolower($themename));
# l& u- i7 Q( h# @# ^8 Q. ^6 [. ^8 L J5 f4 t1 Y1 S0 }
function get_theme_option($option); x$ R7 d& J/ }) w6 h1 ?
{( n( l6 U! M. z5 s& `1 i0 D
global $shortname;
: m% @- h0 Q8 O! j4 a3 t) x/ l return stripslashes(get_option($shortname . '_' . $option));& J. @" O6 i! S* U
}
5 j5 L( e* A! r( E3 e% v8 k6 \0 D; D6 @' ]
function get_theme_settings($option)8 E2 g( @3 h& V
{
8 L" s) E* `0 m2 S% D! l return stripslashes(get_option($option));
3 w% Q$ p4 H9 x( i4 r. Q3 e2 |$ G}
1 x, Y5 b1 X6 f" J; l5 \$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");; b1 w! ?, y: @, P3 l+ `3 W/ w" e
$wp_getcat = array();
6 p; n! M: b7 V6 `. l7 N) r1 Xforeach ($wp_dropdown_rd_admin as $category_list) {
( c, F' ]% u2 I8 V9 x; T) H$wp_getcat[$category_list->term_id] = $category_list->name;4 [( Y" z! J9 o! o1 O& b- P% c
}: z1 j/ D' A& `' ]' O+ J
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");, U: V! j3 D, W( Z! E
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");( }% ^3 [# X4 F* h) c
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");/ M8 N: p$ J# Y6 e- g5 g
; s5 m9 h5 ?) F8 f+ b+ m9 k/ H
$options = array (- q1 ^; y7 `2 M+ i- c+ v
8 c& _+ X% Q ]' r
! l. F- r7 k- ?3 h, |& n array( "name" => "Blog Header Settings",
! Z9 L) o* k4 n3 `5 E "type" => "heading",
9 I* I& p. K1 L- f, F ),
( Y3 n3 P: ?6 o4 w U- U. u8 M b2 z8 F9 F# ]2 k$ m
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 c+ @6 G: {* p$ Y "id" => $shortname."_header_logo_activate",
+ O. n$ i6 @& U0 J4 _ "type" => "select",( B+ S: \* w" m
"std" => "No",- z8 D* X" Q: A b) t/ l
"options" => array("No", "Yes")),& A5 E# n' q8 A
+ _6 x3 N1 u9 h* R& H
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",5 K$ S. |9 u# I0 H8 x4 s% x0 V
"id" => $shortname."_logo_url",* M) w- M' x ~" s( W6 H, g1 F/ i
"type" => "text",
, Y g) z' @8 t "box" => "social", ^" m8 X4 v3 c* [, z: k
"std" => "",5 G o6 T) P* g9 `' }/ V+ d; c
),$ Y& B4 z' [: Y+ t+ a' {
% r; Q! t* c# m4 ~# w% {1 M array( "name" => "Insert Header Banner HTML Code (Header)
( F- m& I# A+ [7 l7 R5 p9 [ <br /><em>*Recommended Size 468 x 60</em>5 L: F6 B1 ]+ `
<br /><em>*leave blank if not use</em>",
8 R( o; v3 x K. G "id" => $shortname."_header_banner",; _; \6 _/ X, o/ d' P
"type" => "textarea",+ ^2 X" C: e! ]
"std" => "",8 R( n+ U" h; ^6 h
),& B3 Q0 ?6 j0 l% e
0 @& M1 A: Q3 g+ q; V9 }
array( "name" => "</div></div>",
9 y) t# ~* H8 q$ D$ e' @ "type" => "close",
# `1 \- t( R6 O, f( ?5 ~ ),
) _4 h$ ?5 x7 y4 u4 e
. v6 V; y/ ?- L1 i+ k6 Y
7 ^& F9 S" a) g8 _5 i! y8 f array( "name" => "Header Navigation Settings",
4 a2 g+ g3 }) k3 x1 u/ N "type" => "heading",
1 g6 K! N7 t' K T- i. _/ w ),
6 i0 V, y1 n7 x7 E f
+ f9 r g- d8 Y* L6 D! G array( "name" => "Insert Page ID To Exclude On Header Navigation<br />' c' e! E7 l4 i9 y* s. _# _1 P
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />4 V: I3 w' m8 P& ?
<em>*Enter the page post ID number only</em><br />8 c/ r& }$ f# w6 }% M" {
<em>*separate by comma</em><br />2 {7 T% P V i L0 P ~5 d
<em>*Exclude pages which you don't want to show on the header navigation</em>",! ?6 U- F: P% W# O0 f j) e8 c1 X' A
"id" => $shortname."_header_page_navigation",
/ Y" p2 u" t6 @0 S2 c "type" => "text",
; Z# u( L4 m1 F8 \ i "std" => "",
8 a' s9 u5 \: K4 O ),5 M4 `1 w$ [7 _: z
. k) M( V! Q* I9 Z' L! l array( "name" => "</div></div>",6 w6 i; z2 }$ e6 ^5 c, n1 ?2 i, t
"type" => "close",
& S* n0 l. l4 F ),
1 [% X1 Y; Q2 {( T' {" l * y4 f. \% I5 T5 t
3 W0 ?" d k J, M" w" K1 b( I- O
array( "name" => "Post Auto Thumbnails Settings",
% ^" a# B" `% E* c* g$ {- ~$ e9 g( ` "type" => "heading"," v- x+ G( g! k" y1 d9 I3 V, e
),0 K) Y% e2 ^& T* z! I
$ {: @+ ?8 ~4 L! [ C1 E6 w! ~ array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
+ p8 V( R8 ~0 G% o "id" => $shortname."_timthumb_activate",
" c& U' ~+ J) v( o. i6 `( f8 \" K "type" => "select",
+ g o: T) D# Y4 S. E7 t) U7 [1 k. @ "std" => "No",+ k1 _0 a0 K2 h( Y% y1 Y% e. m
"options" => array("No", "Yes")),1 y j# `& F3 ]. |% R) ]1 n
" e, |. A6 _$ p array( "name" => "If Timthumb is enabled, Please choose its cropping method",; I4 K0 H4 v q& o" Y7 P
"id" => $shortname."_timthumb_cropping",
/ }; }, D( k+ p; X8 o* w$ h "type" => "select",
0 H5 r w' Q0 t' m0 F6 k: P' X* Z "std" => "",1 b, I' O! ~. C& g8 J- d
"options" => $crop_position),
* y$ i' Y$ U: ]- U6 @2 D q7 _
& W1 K! Z1 Q, A# O, [ p array( "name" => "Insert Width Of Thumbnail Image<br /># z6 n, V# C; B) z5 z) `6 y3 u
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
$ W, \, f( o2 ?4 N' F6 | <em>*Leave Blank To Use Default: 250</em><br />",
" x. B# Y- N4 a% Y$ { "id" => $shortname."_thumb_width"," v& X; B$ K& t' l* v8 W; _9 K. ?
"type" => "text",+ |# u8 Y* t( a+ F- y/ E8 e9 `
"std" => "",
' K' \. l2 P8 O; c9 h& r7 @ ),
- i" h: u, ~5 T; o! X; g
) y) R9 I; X5 Y4 b* } N array( "name" => "Insert Height Of Thumbnail Image<br /># k0 ]2 B" a4 I M" R
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
* i! B2 ?, O( G% g. ], \" b) \! d9 s <em>*Leave Blank To Use Default: 200</em><br />",$ G, K8 I2 y6 {) P' ~4 M" V
"id" => $shortname."_thumb_height",6 p, C7 y {- Y
"type" => "text",
7 f" ?4 K/ x1 Y4 K0 E% T "std" => "",) v* c" T1 `1 h3 X/ \
),
@3 i; D& n2 k# `& x, D+ u8 r( H% J- d9 ?( _1 q9 i
array( "name" => "</div></div>",
! u3 H: B5 U% {: W W "type" => "close", b) u1 C+ W0 c8 y
),/ ^( X5 W5 k# X# o7 h) P1 r
7 S# P$ x) b6 O6 }& A
array( "name" => "Featured Content Slider Settings",
& r5 ?- c3 Y1 K: ` @! e1 J "type" => "heading",
! _+ e4 P* G; C8 N! l1 {+ S ),) U' R7 {- n+ E/ _
0 M9 D5 \" E' `, E! R3 Q& C
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& |! H& r- ] m6 L7 j
"id" => $shortname."_featured_activate",
( c* \9 y( U+ ^$ z0 M; D2 x "type" => "select",
1 l: u' j2 I8 t+ @ "std" => "No",3 a: C9 q4 s# Z! E1 u
"options" => array("No", "Yes")),
4 f. Z+ I8 I' k
1 L2 ?/ w4 a% D) m3 c! ]! a% H
! v, Y2 q; F6 ]% x array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
5 O) _( q4 y% `: L "id" => $shortname."_featured_category", p s% H, H& N" K5 L0 y3 T/ v0 I
"type" => "select",# v* s9 S8 O! X4 n4 _4 E
"std" => "Choose a category:",
* m4 u( C3 c# F( t9 b5 M "options" => $wp_getcat),
V. \2 [( u7 ?/ n
' t9 l- N3 d' K5 `5 m! B5 {" g. K array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",, i1 V3 ^0 l# @( _* w. u3 a! Y
"id" => $shortname."_featured_number",7 W& g* M5 L$ j7 |8 r+ \5 i8 d2 Y
"type" => "select",
- p& a" V/ Y1 {, N: \ "std" => "Number of post:",
+ k+ R! I# z. \# }7 a "options" => $number_entries),
* z% ]/ W) R z: ]* m* o7 a1 m% T( Z W* |4 T# {
array( "name" => "</div></div>",1 z9 \4 D& r) O! U1 U3 J
"type" => "close",
+ ` u3 \3 S& q: r5 j# z9 S6 q ),
5 P8 e0 J) y' s2 l
6 ]* q7 x5 G' p( X; c+ L; ~ P array( "name" => "Featured Category Settings",
0 S, U# H6 b5 |2 X% e "type" => "heading",0 {3 I# F" |8 p' y" z
),
, v6 ~0 S, b: [9 S" Q) T
) B% A! z f' o' D array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* O ]7 g( Z, l" z( B- ~
"id" => $shortname."_featured_category_activate",
! r7 j( l0 F$ W8 ?% C/ C$ y "type" => "select",$ u2 |6 ^6 W- j' {- @+ L2 [: @
"std" => "No",9 B6 N* D. t# z3 y. y6 H
"options" => array("No", "Yes")),+ ?* U" s# Y( |, _( t n, w4 K
# F3 V& h6 Q; u% b# ^0 P
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
' `$ @8 [. Y. Y6 }+ q0 g V! O3 ?: o# J "id" => $shortname."_featured_category_id1"," D# ?7 K. A$ R6 D( {1 g
"type" => "select",
: s9 S9 \, a) C# u "std" => "Choose a category:",
8 _7 A* s1 [8 ~, h( A% u& |4 s "options" => $wp_getcat),
/ S5 n% v; D w% ?
5 o" O5 t5 d" [' s8 o9 R' u2 | array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
( Z/ f4 o7 r0 |% ~1 ^* b "id" => $shortname."_featured_number1",8 w: ~ O% A4 w' W1 i8 s
"type" => "select",
6 p1 I% G& ?$ `3 f v/ j "std" => "Number of post:",- P( {3 [8 t) U) L* V" V+ i3 p
"options" => $number_entries),
9 V2 T- }* ] b4 _& Y5 X* t2 o
; k& }' `4 z% D/ B9 b# b% X2 C array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",) W' j+ K2 @" D/ ?6 f6 g
"id" => $shortname."_featured_category_id2",
0 A% W- c5 k- P: c "type" => "select",
& F6 o. H! f( E, U7 Y& l "std" => "Choose a category:",
, `, h) i4 V) Z2 U0 V5 w- B; ] "options" => $wp_getcat),
) S8 v( [& {0 S ? 4 r% z. H4 P0 o4 r! I9 m& C
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",6 b b' Y, T! R* ]+ H# v
"id" => $shortname."_featured_number2",
4 k1 `" t: N5 n0 ^' C7 z3 E9 x! f "type" => "select",
8 f- w2 Q$ G4 v8 O( v0 V/ a "std" => "Number of post:",, `/ a0 k( k7 C+ k% ?
"options" => $number_entries)," j. J) X, I1 n
" b8 r+ Y% T4 w
* Y7 C% c# b% u! \2 u* g W* W8 }1 r array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
5 Y. ^# ]( ~& o "id" => $shortname."_featured_category_id3",6 [6 t2 |! ~3 b4 }4 M
"type" => "select",# w8 L& f/ V( m \9 |! J! U0 j5 D
"std" => "Choose a category:",4 n1 ~3 w" Y B( r/ T. o
"options" => $wp_getcat),; U' K9 R% C% e3 t8 e+ e
6 F& g t' n: q! G. t8 I' t U array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
. `% D, B1 O+ m; @ "id" => $shortname."_featured_number3",
$ ?- Y1 \# N8 e: \- O+ B, A% k "type" => "select",
5 T: q c# T8 O3 z. P "std" => "Number of post:",
2 I$ @5 ~) T) n" X- F2 ^9 e" L! K& o9 Q "options" => $number_entries),
; r, G, w. ?3 f6 D6 n$ b+ Y. P
- o( O" K2 T1 P6 ?% h, t
9 ^% [9 ~0 L; y array( "name" => "</div></div>",! x: U+ X/ S& w: N! F- p7 j
"type" => "close",) E0 y6 L' O Y# F" o1 a' a/ A
),
. V/ ~0 ~6 p. W0 I4 ?' d9 C" h% a# l1 E
: d, s, G- y# c; j: b- j4 ^" e array( "name" => "Google Adsense & Analytics Settings", o% E# q+ v) Q' p/ ]8 w
"type" => "heading",
, V/ H6 G# x1 v2 T ),
l5 g3 N% f: n0 h( l/ v7 N7 h5 {' r* a) K1 f/ i1 c4 f! [) g
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",& @2 D6 t3 u4 u& ?; e- g; u
"id" => $shortname."_adsense_loop_activate",6 M. t) N! ^! w/ b( c8 I2 \% [
"type" => "select",
- I7 Y( F# N5 u. h) N' |$ h' B' { "std" => "Disable",
% o% L: \: G0 I; M9 h1 U7 x( W4 o "options" => array("Disable", "Enable")),& f4 {" [" t3 U3 k8 `$ H
6 w9 L) O; g3 C' l- F2 O array( "name" => "Insert Google Adsense Code For Loops Here<br />1 G9 w$ I+ D& a" _- |7 u9 E
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",% d1 q' Y. o7 y/ A. \
"id" => $shortname."_adsense_loop",
0 _6 a- J! O; ^ "type" => "textarea",
+ V. I# `) V/ B, @6 B "std" => "",
; H. X4 _2 a. x+ W ),' H1 d1 _# g5 v0 a' K; P. Y
, _: d+ J# v- z0 I9 C2 b. k array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",. T, i2 @' N1 g
"id" => $shortname."_adsense_single_activate",
0 O. k8 M- |- Y8 g! f! @ "type" => "select",1 W. V- Q" b) Q$ C; Q/ z: N* _
"std" => "Disable",
% c& G+ ]# @9 x* m" w "options" => array("Disable", "Enable")),
! |; u, i8 _! v2 |% a" y5 ?# K* C. k7 Y3 t
array( "name" => "Insert Google Adsense Code For Single Page Here<br />4 [& Y; l" g/ W" E; y
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",4 O4 `" ^+ I% |
"id" => $shortname."_adsense_single",
5 b6 Y$ O, ~3 N5 N4 y "type" => "textarea",. ^8 _9 J. t: @7 \$ b' H8 [
"std" => "",, X0 K) ^( u+ n) N+ Q: w
),
# ?+ T1 _1 G) c) H* L! K( r2 N* \7 g+ X2 w/ }7 J
" ^- V3 u0 e9 F& n
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
4 }) [; G$ w2 J8 Q1 y( C% V "id" => $shortname."_google_analytics",' g4 p- o+ I% W, H
"type" => "textarea",) Y9 F, P: s# O& O3 h7 n+ R3 w/ H
"std" => "",
0 v' J) \; h1 X; i8 t4 N ),. b$ v+ ^# u- R: m2 m- B4 k
/ K5 h! d% Z+ K' W0 Y7 M' Z6 g array( "name" => "</div></div>",
) ]& S6 j+ h* C5 ~ "type" => "close",8 M8 |7 l& C" d6 I8 y
),
' k/ k+ I+ ~5 {1 X4 [ 2 }) L* B g- D* S
7 r% z% H/ q' _+ q7 W
array( "name" => "AddThis Social Bookmarking Settings",
7 i( L$ h/ q% W1 Q# u* X "type" => "heading",. i$ x8 m3 N6 n" G
),
4 l! `2 _6 E& t! b8 Q$ R6 ~; }. l
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
6 g2 d' N0 H9 f9 } m) U <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
9 Y+ x$ A& }: u0 D& }" Z "id" => $shortname."_addthis",2 W9 t6 G" g! J7 T4 Q
"type" => "text",
( v1 D: b7 D) m% j( e "box" => "social",/ J( A7 _! E: S5 a+ x4 \) V, ]: n
"std" => "",+ b9 }5 }/ {( i; M4 r
),. K/ h; z. H7 Z# \2 x
* ?( v* p7 w5 f0 u0 H
array( "name" => "</div></div>",0 F6 f2 T/ I( P( t0 i
"type" => "close",6 ?! Q7 }9 v) i8 j; e
),% _# x( s7 u. O( z$ O, _% s3 Z
0 }5 |% C$ X7 N) g7 j" [( K8 X4 ]$ `
: `8 {; ~6 p/ o% X2 K6 A
& C) ~: H9 {( Y0 i9 J7 W array( "name" => "YouTube Video Settings",
7 ]2 K k" Z- J6 A, }) d "type" => "heading",. t4 v7 n" V& x2 t8 Q( M! z$ Q
),1 h. P, p/ V, e
1 H% d4 G6 \0 c6 I
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 O) W4 @' _! ?, v- }# M: S
"id" => $shortname."_emvideo_activate",+ U, }( y! n5 Q# x
"type" => "select",2 l) y+ R, ?1 n$ p0 u! M8 u
"std" => "No",
: c: c. K. X3 c+ v "options" => array("No", "Yes")),
' N, h7 R0 c% Q+ x6 u! q+ B/ Y; p# J; C# K$ q
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>",
- K# ]7 s+ N$ V0 Z "id" => $shortname."_emvideo",
- N/ C9 G, m c. L6 w8 j2 w7 E( ? "std" => "",% b# i% ?& d( s% h; N
"type" => "text"),7 `; ^; L3 H" V' H
# d% G7 C6 ^4 O2 u
array( "name" => "</div></div>",
; g6 }7 t- _7 p& D "type" => "close",
9 \9 D: {( S) D8 {9 l3 G ),8 [1 s R M7 F5 u/ i( ?/ ?- w' d
* [% i ?% ]$ c6 [5 d% q+ N" m array( "name" => "Twitter Settings",
5 G: [( B3 A4 {/ ]8 d "type" => "heading",7 F: z. J; ~# w" B* M
),0 y# e/ S) |4 o
, F m$ L2 a5 Q" t8 D7 | array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% _( X0 t5 n5 Z2 a0 { "id" => $shortname."_twitter_activate",
0 _; A& G/ t* t3 J' f7 `" e "type" => "select",
% F8 J3 e+ c# I; U- S "std" => "No",
; e, X' P2 g$ s8 \" u/ ` "options" => array("No", "Yes")),8 k, q1 D& o0 a% A" G
c9 l7 m2 U( H' \7 Q array( "name" => "Insert Your Twitter ID here
" d0 t/ Z' ~: M& k <br /><em>*leave blank if not necessary</em>, U) h" n9 f$ U# c0 c0 w2 ^) o3 \) O
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",* a/ D0 \ T9 r
"id" => $shortname."_twitter",# g* p. h( q' {" [% H+ D* G
"type" => "text",
6 t& ?- q% k1 Z- a: V& }" j "box" => "social",0 N7 C# b! {; Z& K4 Z
"std" => "",
6 J# {+ h' j; {9 v$ Y ),
& U. c6 X3 Z2 [8 M! a* O9 d& n5 g! ]% r
array( "name" => "Enter Twitter Feed Count here/ h5 c3 C& ]1 h* |- u2 n2 w6 I7 Y
<br /><em>*leave blank if not necessary</em>7 z" B8 e9 y! {. \; l
<br /><em>*Enter How Many Twitter Feed To Display</em>",
3 C: J, v, |. F" O: ~ "id" => $shortname."_twitter_count",5 f5 B0 Y# X; B9 I. ~
"type" => "text",& o% {$ j0 v$ i
"box" => "social",: B l+ r! b/ D" b. M! G
"std" => "",
6 a7 b. A1 ^1 k ),
' e# l- [4 P3 |; u0 s' I& L; [6 Z8 B% d" Z: G! f5 t% t
array( "name" => "</div></div>",
# _, i$ O, O9 q( j q% \( L "type" => "close",* J$ n1 }: r; B7 s. |# J& A
),
\8 i3 [% Y; h+ P5 q7 [0 H
* p7 v- N* E4 L8 S6 g( k9 s' J
* [/ y! x* i# w5 T7 A array( "name" => "125 x 125 Banners Advertisement Settings",
& Z* i; P |4 J* J6 b( S "type" => "heading",8 _: U6 v9 x X- T
),/ K- [6 t% N9 m& ?" v) s
/ \! u+ B: K7 ]+ |( \ j. I& i6 U- Z
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
' T- I( \ K& h: o "id" => $shortname."_sponsor_activate",' v. Y2 @( @* ~
"type" => "select",$ {) H6 F# T0 L+ G9 T g! W
"std" => "No",
& w9 u6 Q s$ a0 a: J "options" => array("No", "Yes")),9 N0 M. ^$ U8 N- P% A3 f+ j
( ~' k9 i0 K2 z9 c! [
( J) V# v7 b+ L- y, v5 m
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
+ U. D6 T0 ^9 D/ d q. C "id" => $shortname."_sponsor_banner_one",9 ]# {3 W! J, W" \9 s
"type" => "textarea",
: D' P% x/ }0 I! B "std" => "",
' B, @2 J3 I. b) r: A2 F5 A ),
6 P3 F9 W3 r! m' M3 N9 {+ U: C' g% Q9 a% K2 m5 ?
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
- b* ]' F' _0 I "id" => $shortname."_sponsor_banner_two"," ^7 u# C' W, ]# `( p
"type" => "textarea",6 c% ?/ O( }' S+ m6 f
"std" => "",1 j6 O' U4 ?3 G0 m5 H
),+ ]4 r% b8 Y/ A% O0 Y4 H/ C- \
7 E/ l$ c* [3 t* c7 I# [: @
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",7 }) G1 \/ U8 [, K8 e l) n& R
"id" => $shortname."_sponsor_banner_three",5 X6 F5 s$ `) t7 M% }! U }
"type" => "textarea",
! e6 _- R* R- J "std" => "",! f6 r- A* K% [" Y v7 j4 {
),% k9 ]5 g6 o& @' w1 ?
0 H9 }! l6 I4 P$ i% a# T7 g3 u& \$ O array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
" s! E0 \/ M {7 {# Z% W3 ` "id" => $shortname."_sponsor_banner_four",: z4 R2 X* ` l7 w T' Y% ^
"type" => "textarea",+ I( ^7 k9 ?) k
"std" => "",5 q. `- d, ^, C& l2 F/ @
),
: \% D( E$ m* `! r7 Y& _4 d+ \" |- y
$ y7 O5 |; A1 | array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",* `1 ]6 Q; a8 R# Z6 ?: v1 a2 ]
"id" => $shortname."_sponsor_banner_five",
& ~& y. F6 l* l6 q2 ~ "type" => "textarea",: g1 `9 s$ v% ?8 N/ ]( a* R
"std" => "",
: D9 F. Q% g: _: K5 S+ u/ p) z- c ),
1 L- a7 k4 b! B! O4 L8 }; k7 Y: h0 s: G8 V) ?: I1 S
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",; }1 a( }$ k, M- X2 R
"id" => $shortname."_sponsor_banner_six",
1 ?, K. c( `. g. \$ ?7 w3 { C "type" => "textarea",% e1 U* @1 \5 g
"std" => "",
$ e: D8 R! B) \: { ),& `1 `/ x, E$ ^2 w3 u5 A. m
' o l. O3 K' k8 B+ Y9 y3 i9 i
array( "name" => "</div></div>",
3 _6 m! y0 V- q4 H2 p0 W$ H0 Q "type" => "close",! F; `3 R; u6 [/ y& ]. f# T* ?
),$ S/ o! N) ?5 U) _) T+ t& r
2 O/ C; M+ Q$ x& M9 {
% | d# T4 a# _# F
) F# g$ k( u: m: n
);
; d( U# B. @3 m, S2 \0 \: C+ ^7 X& R3 s' R3 X, z7 W0 h& M( s
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {. a) i2 b& W3 v
6 F- } n) E- b- `; R! d% I |0 a
echo "<div id=\"admin-options\"> ";- M2 h, {% C( n( b$ \5 b$ C
$ Q$ s3 W8 O" e3 t. D
global $themename, $shortname, $options;# {0 t! r- N2 E$ i+ V+ H# _# c
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
! T2 O- `3 Z$ h& h1 C. {if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
" y/ h) `8 L: b ~$ b2 m?>
- |& g" Z' a7 Q2 D% s+ c
7 H- u. Z& [) ?0 D! \' x<h4><?php echo "$themename"; ?> Theme Options</h4>
5 r5 C- o7 }+ r6 e8 T' }7 }, ^, z$ |6 [; V
<div class="annouce">
o/ F; `! a9 N0 P! ^<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
! q0 G( N" x" j* z5 e- b6 T5 z3 ~9 s<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>) l: f8 b& v1 W+ T
</div>) x0 c* t3 K/ I% J. {& `
" B0 |/ B8 C H8 @7 }
<form action="" method="post">
; }5 b y1 S' B; C# U+ h; V% D* b2 m% I( L
<?php foreach ($options as $value) { ?>
& \0 v/ S# ~+ X, |' B% B1 ^# P. o4 \
<?php switch ( $value['type'] ) { case 'heading': ?>
" g7 U' u1 Z7 E/ j# l6 t
% Y- a0 K5 Q/ M4 v1 N<div class="get-option">, o: @) K* \" @, k [
, ]& [4 I+ E! a% r$ Q
<h2><?php echo $value['name']; ?></h2>8 ?. p6 c; f) p
# @3 d4 T, \, l0 m4 Y4 j<div class="option-save">& g u% M# ]& Y+ z/ _
$ H4 m' d6 Z4 E$ Q6 j<?php
% G$ ]; V$ H. ]7 tbreak;" P e+ _# u( S. S2 v
case 'text':' b0 v4 k' @* p/ V# L; f
?>% Q0 j# q h7 ^! T
5 ?8 F: G' v" B8 E) E+ y<div class="description"><?php echo $value['name']; ?></div>
1 ~& W' [0 X& N<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
. h o/ t& p9 o# A1 T; e; f( [5 U+ a$ i2 o% T
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p># i: k+ R' m% B7 ]0 e
" e* H4 n: z4 Y8 R" Z9 C) a4 o
<?php
. I7 Y) `3 P: e Sbreak;
8 Q- ~% e' H# X0 ?$ U; i! [* Scase 'select':
, t5 Y k& j9 h5 t5 J9 M; T$ E?>
/ {4 t: o* l( C( V: {3 U3 R V) M( {$ c- W0 E
<div class="description"><?php echo $value['name']; ?></div>
4 X/ g2 k( f: [0 t2 S2 {<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>"># j+ U: W4 i$ v7 ^! M9 l2 b, O
<?php foreach ($value['options'] as $option) { ?>) D1 Y* ]9 D1 ?8 r3 N
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>, {( K4 l+ x# B5 P9 ^& p+ z4 H6 R
<?php } ?>
2 W1 e A' @8 @% k9 Q8 h0 b</select>/ G# i7 C* f+ f9 {
</p>- M' U' |- @8 N
2 V* T1 u$ T V8 e6 u' l<?php: P* K3 [; O- R" f6 d
break;
6 A3 e9 ]* x" v6 ?* K" y. Ocase 'textarea':. p: }6 K) J, W9 k l! e
$valuex = $value['id'];7 g! O0 q8 H4 M$ n( t. Z
$valuey = stripslashes($valuex);6 _0 ^6 |: \# t- a: _7 f1 `
$video_code = get_settings($valuey);
. q( `3 r z g?>2 D Y$ n+ I$ \3 @" O2 _6 S8 t. V) w
0 G, O& z i2 W8 g<div class="description"><?php echo $value['name']; ?></div>! [3 D5 P- i4 _" O0 S
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
) b$ \6 g6 ~ j) B u" T
/ S1 c: b4 j2 a' `' b. q* e( W3 d5 Telse { echo $value['std']; } ?></textarea></p>
4 \9 A- x# ~/ Z; t' b6 P" Y. e A# Q
<?php
$ ~6 X. k5 ~0 ]8 v, F5 vbreak;4 k; P& [, R& z' f; d: c; [
case 'close':
) S: v$ g/ v2 E4 l2 y2 F+ `; ^& z?>
$ M* q& \) @: I9 O4 E& S, V' a( Z& ^1 t. S# O. g4 f0 U3 \) W, k/ O6 R
<div class="clearfix"></div>
- e8 P* d$ w' @, a$ b& O/ o0 H</div><!-- OPTION SAVE END -->
0 l3 b! ~/ ~; n! ?! _2 c I1 u; ^# x, B
<div class="clearfix"></div>
1 m+ Z, J) P5 I# o: j# N& n; p</div><!-- GET OPTION END -->0 {% L* T3 T* @( L' ?2 a5 @
' ~7 D3 O0 U6 \9 W2 t& k0 u5 B: k<?php
, r& c9 P$ O0 a, O' A7 x( _break;. L8 `: v! S" {4 p, M* i' u% Z
default;
+ Z* V# [9 M- m( p. j( b0 B?>9 Q! i6 f; Z% a- v
* M6 e+ o& I5 }( a/ B' U4 H/ w' ~6 d+ ^ |; k4 i5 u
<?php/ F5 D8 }, I) r8 G$ c+ U, f" M; V
break; } ?>
& i0 y) i) M! L# V2 _ ^
, f3 L6 {+ B' `; \3 u' u- x<?php } ?>
" I! l$ F/ L. q% L# ~" F4 R! \! A; J) ~7 X. I
<p class="save-p">
$ U. V! S I7 Q# |( `<input name="save" type="submit" class="sbutton" value="Save Options" />! L# y: P3 P5 j j# j( z% S
<input type="hidden" name="action" value="save" />* I8 P U y- O/ [
</p>
& P% `3 [) m+ f</form>2 Z" g) R* K6 v0 v) H2 a
; c B/ q, S6 l# X: x! y. I/ i
<form method="post">& d5 z; }2 p# w6 @
<p class="save-p">5 v; g- f+ E& e( o2 M1 X/ E! l) Z6 o
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
5 Q. {% u3 S }<input type="hidden" name="action" value="reset" />
8 p+ K$ O1 J: J8 }3 F</p>
7 @; E. u4 Z% o9 x, T" S& o</form>
; x: Y4 t* Y( v( Z1 \! S9 N8 @* Q
1 `- y2 B- u: I4 l</div><!-- ADMIN OPTIONS END -->
6 z- z& W2 W$ L, _, N1 |/ y; |( L7 g3 i; ?+ Q M; d; b, F
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
9 m! Y/ z, R3 L F. j/ n& Q
; L, K7 ~( G1 i) W, yfunction mytheme_admin_register() {5 ~* i! U( ~2 W
global $themename, $shortname, $options;
I x! j1 t0 e% rif ( $_GET['page'] == basename(__FILE__) ) {
- q) k" u Q: _: R7 q* W2 Mif ( 'save' == $_REQUEST['action'] ) {0 l8 [9 V- w% P/ P- k7 [
foreach ($options as $value) {
( X9 E5 `; ]0 M, ~ i' q; m( g1 Gupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
8 h- Q+ B: e5 D" Y- ~6 j. l7 p9 Uforeach ($options as $value) {
, Z1 P, \3 ~* }1 g$ o* R$ Tif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }. Z4 h% G6 r) s# a( X; m
header("Location: themes.php?page=functions.php&saved=true");4 o8 `2 s6 w" Z; N, h
die;! }$ K% Q `+ K* \7 @; z! @
} else if( 'reset' == $_REQUEST['action'] ) {
( A$ @9 [5 z& B1 Zforeach ($options as $value) {
8 ]6 c& p* L9 e' zdelete_option( $value['id'] ); }6 e# o3 {. W" I) g- c
header("Location: themes.php?page=functions.php&reset=true");7 D( v3 m( d# c
die;( v, A- x8 W4 c9 I" G$ B5 S
}' q& N/ N, U* H
}/ {. L% X+ \$ Z# T
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');( I: R& g n9 u+ u& M- J- E
}# [% \% x: g- c+ j
' a U$ V' @! u$ V# d3 b
function mytheme_admin_head() { ?>
# F5 u$ `* a6 e* T; T' ]<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
. e! m" ^" p( t- }# r* e }<?php }
8 K Q) w' p. u) G |
|