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