|
|

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