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