|
|

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