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