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