|
|

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