|
|

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