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