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