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