|
|

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