|
|

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